MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / confirmSwitchSession

Function confirmSwitchSession

app/src/modules/sessions.js:84–92  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

82}
83
84async function confirmSwitchSession(session) {
85 const label = trunc(getSessionTitle(session), 40);
86 const ok = await showConfirm(`切换到会话 "${label}"?\n当前对话进度不会丢失。`);
87 if (!ok) return;
88 closeSessionDrawer();
89 if (S.ws && S.ws.readyState === WebSocket.OPEN) {
90 S.ws.send(JSON.stringify({ type: 'switch_session', sessionId: session.sessionId }));
91 }
92}
93
94export function initSessions() {
95 $('btn-sessions').addEventListener('click', openSessionDrawer);

Callers 1

renderSessionListFunction · 0.70

Calls 4

truncFunction · 0.90
showConfirmFunction · 0.90
getSessionTitleFunction · 0.70
closeSessionDrawerFunction · 0.70

Tested by

no test coverage detected