fix: satisfy chat pending switch lint · openclaw/openclaw@ab3a3d1
shakkernerd
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -325,7 +325,7 @@ function waitForPendingChatModelSwitch(
|
325 | 325 | if (!pending) { |
326 | 326 | return true; |
327 | 327 | } |
328 | | -return pending.then((ok) => ok !== false); |
| 328 | +return pending; |
329 | 329 | } |
330 | 330 | |
331 | 331 | function clearSubmittedComposerState( |
@@ -341,7 +341,7 @@ function clearSubmittedComposerState(
|
341 | 341 | host.chatAttachments.every( |
342 | 342 | (attachment, index) => |
343 | 343 | attachmentSubmitSignature(attachment) === |
344 | | -attachmentSubmitSignature(submittedAttachments[index]!), |
| 344 | +attachmentSubmitSignature(submittedAttachments[index]), |
345 | 345 | ); |
346 | 346 | const clearedDraft = host.chatMessage === submittedDraft && attachmentsUnchanged; |
347 | 347 | const clearedAttachments = clearedDraft; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -350,7 +350,7 @@ async function switchChatModel(state: AppViewState, nextModel: string): Promise<
|
350 | 350 | let switchPromise: Promise<boolean>; |
351 | 351 | const clearPendingSwitch = () => { |
352 | 352 | if (state.chatModelSwitchPromises?.[targetSessionKey] === switchPromise) { |
353 | | -const nextSwitches = { ...(state.chatModelSwitchPromises ?? {}) }; |
| 353 | +const nextSwitches = { ...state.chatModelSwitchPromises }; |
354 | 354 | delete nextSwitches[targetSessionKey]; |
355 | 355 | state.chatModelSwitchPromises = nextSwitches; |
356 | 356 | } |
@@ -374,7 +374,7 @@ async function switchChatModel(state: AppViewState, nextModel: string): Promise<
|
374 | 374 | } |
375 | 375 | })(); |
376 | 376 | state.chatModelSwitchPromises = { |
377 | | - ...(state.chatModelSwitchPromises ?? {}), |
| 377 | + ...state.chatModelSwitchPromises, |
378 | 378 | [targetSessionKey]: switchPromise, |
379 | 379 | }; |
380 | 380 | return switchPromise; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。