mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 15:20:42 +00:00
fix: satisfy chat pending switch lint
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user