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

Function initSessions

app/src/modules/sessions.js:94–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94export function initSessions() {
95 $('btn-sessions').addEventListener('click', openSessionDrawer);
96 $('session-drawer-close').addEventListener('click', closeSessionDrawer);
97 $('session-overlay').addEventListener('click', e => {
98 if (e.target === $('session-overlay')) closeSessionDrawer();
99 });
100 $('btn-new-session').addEventListener('click', async () => {
101 const ok = await showConfirm('新建会话?当前对话进度不会丢失。');
102 if (!ok) return;
103 closeSessionDrawer();
104 if (S.ws && S.ws.readyState === WebSocket.OPEN) {
105 S.ws.send(JSON.stringify({ type: 'chat', text: '/clear' }));
106 }
107 });
108}

Callers

nothing calls this directly

Calls 3

$Function · 0.90
showConfirmFunction · 0.90
closeSessionDrawerFunction · 0.70

Tested by

no test coverage detected