fix(composer): avoid draft restore while busy

This commit is contained in:
JOJO 2026-05-25 22:57:29 +08:00
parent b03d158ab6
commit 41305ae2a8
2 changed files with 14 additions and 1 deletions

View File

@ -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;

View File

@ -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'}`
);