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) {
|
||||
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;
|
||||
|
||||
@ -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'}`
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user