diff --git a/static/src/app/methods/ui.ts b/static/src/app/methods/ui.ts index 94b27b4..fde9468 100644 --- a/static/src/app/methods/ui.ts +++ b/static/src/app/methods/ui.ts @@ -420,6 +420,14 @@ export const uiMethods = { if (Number(this.composerDraftFetchSeq || 0) !== fetchSeq) { return; } + if (this.taskInProgress || this.composerBusy) { + debugLog('[UI] 跳过输入草稿恢复(任务运行中)', { + reason, + taskInProgress: !!this.taskInProgress, + composerBusy: !!this.composerBusy + }); + return; + } const content = this.normalizeComposerDraftContent(payload?.data?.content || ''); this.composerDraftLastSyncedContent = content; this.composerDraftDirty = false; diff --git a/static/src/app/watchers.ts b/static/src/app/watchers.ts index 05fec2c..6f1999a 100644 --- a/static/src/app/watchers.ts +++ b/static/src/app/watchers.ts @@ -81,7 +81,12 @@ export const watchers = { newValue, skipConversationHistoryReload: this.skipConversationHistoryReload }); - if (oldValue !== newValue && typeof this.restoreComposerDraftState === 'function') { + if ( + oldValue !== newValue && + !this.taskInProgress && + !this.composerBusy && + typeof this.restoreComposerDraftState === 'function' + ) { this.restoreComposerDraftState( `watch-conversation-id:${oldValue || 'none'}->${newValue || 'none'}` );