fix: satisfy chat pending switch lint

This commit is contained in:
Shakker
2026-05-07 22:40:26 +01:00
parent 6f4272bd04
commit ab3a3d14f0
2 changed files with 4 additions and 4 deletions

View File

@@ -325,7 +325,7 @@ function waitForPendingChatModelSwitch(
if (!pending) {
return true;
}
return pending.then((ok) => ok !== false);
return pending;
}
function clearSubmittedComposerState(
@@ -341,7 +341,7 @@ function clearSubmittedComposerState(
host.chatAttachments.every(
(attachment, index) =>
attachmentSubmitSignature(attachment) ===
attachmentSubmitSignature(submittedAttachments[index]!),
attachmentSubmitSignature(submittedAttachments[index]),
);
const clearedDraft = host.chatMessage === submittedDraft && attachmentsUnchanged;
const clearedAttachments = clearedDraft;

View File

@@ -350,7 +350,7 @@ async function switchChatModel(state: AppViewState, nextModel: string): Promise<
let switchPromise: Promise<boolean>;
const clearPendingSwitch = () => {
if (state.chatModelSwitchPromises?.[targetSessionKey] === switchPromise) {
const nextSwitches = { ...(state.chatModelSwitchPromises ?? {}) };
const nextSwitches = { ...state.chatModelSwitchPromises };
delete nextSwitches[targetSessionKey];
state.chatModelSwitchPromises = nextSwitches;
}
@@ -374,7 +374,7 @@ async function switchChatModel(state: AppViewState, nextModel: string): Promise<
}
})();
state.chatModelSwitchPromises = {
...(state.chatModelSwitchPromises ?? {}),
...state.chatModelSwitchPromises,
[targetSessionKey]: switchPromise,
};
return switchPromise;