fix(composer): avoid draft restore while busy
This commit is contained in:
parent
b03d158ab6
commit
41305ae2a8
@ -420,6 +420,14 @@ export const uiMethods = {
|
|||||||
if (Number(this.composerDraftFetchSeq || 0) !== fetchSeq) {
|
if (Number(this.composerDraftFetchSeq || 0) !== fetchSeq) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.taskInProgress || this.composerBusy) {
|
||||||
|
debugLog('[UI] 跳过输入草稿恢复(任务运行中)', {
|
||||||
|
reason,
|
||||||
|
taskInProgress: !!this.taskInProgress,
|
||||||
|
composerBusy: !!this.composerBusy
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
const content = this.normalizeComposerDraftContent(payload?.data?.content || '');
|
const content = this.normalizeComposerDraftContent(payload?.data?.content || '');
|
||||||
this.composerDraftLastSyncedContent = content;
|
this.composerDraftLastSyncedContent = content;
|
||||||
this.composerDraftDirty = false;
|
this.composerDraftDirty = false;
|
||||||
|
|||||||
@ -81,7 +81,12 @@ export const watchers = {
|
|||||||
newValue,
|
newValue,
|
||||||
skipConversationHistoryReload: this.skipConversationHistoryReload
|
skipConversationHistoryReload: this.skipConversationHistoryReload
|
||||||
});
|
});
|
||||||
if (oldValue !== newValue && typeof this.restoreComposerDraftState === 'function') {
|
if (
|
||||||
|
oldValue !== newValue &&
|
||||||
|
!this.taskInProgress &&
|
||||||
|
!this.composerBusy &&
|
||||||
|
typeof this.restoreComposerDraftState === 'function'
|
||||||
|
) {
|
||||||
this.restoreComposerDraftState(
|
this.restoreComposerDraftState(
|
||||||
`watch-conversation-id:${oldValue || 'none'}->${newValue || 'none'}`
|
`watch-conversation-id:${oldValue || 'none'}->${newValue || 'none'}`
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user