mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-26 10:41:41 +00:00
fix(cli): stabilize resume callback deps (#3533)
This commit is contained in:
parent
69da115dcf
commit
78037d996b
1 changed files with 8 additions and 4 deletions
|
|
@ -62,9 +62,11 @@ export function useResumeCommand(
|
|||
const { config, historyManager, startNewSession, setSessionName, remount } =
|
||||
options ?? {};
|
||||
|
||||
const hasHistoryManager = !!historyManager;
|
||||
const { clearItems, loadHistory } = historyManager || {};
|
||||
const handleResume = useCallback(
|
||||
async (sessionId: string) => {
|
||||
if (!config || !historyManager || !startNewSession) {
|
||||
if (!config || !hasHistoryManager || !startNewSession) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -88,8 +90,8 @@ export function useResumeCommand(
|
|||
|
||||
// Reset UI history.
|
||||
const uiHistoryItems = buildResumedHistoryItems(sessionData, config);
|
||||
historyManager.clearItems();
|
||||
historyManager.loadHistory(uiHistoryItems);
|
||||
clearItems?.();
|
||||
loadHistory?.(uiHistoryItems);
|
||||
|
||||
// Update session history core.
|
||||
config.startNewSession(sessionId, sessionData);
|
||||
|
|
@ -114,7 +116,9 @@ export function useResumeCommand(
|
|||
[
|
||||
closeResumeDialog,
|
||||
config,
|
||||
historyManager,
|
||||
hasHistoryManager,
|
||||
clearItems,
|
||||
loadHistory,
|
||||
startNewSession,
|
||||
setSessionName,
|
||||
remount,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue