MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / currentSession

Function currentSession

app/store/chat.ts:380–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378 },
379
380 currentSession() {
381 let index = get().currentSessionIndex;
382 const sessions = get().sessions;
383
384 if (index < 0 || index >= sessions.length) {
385 index = Math.min(sessions.length - 1, Math.max(0, index));
386 set(() => ({ currentSessionIndex: index }));
387 }
388
389 const session = sessions[index];
390
391 return session;
392 },
393
394 onNewMessage(message: ChatMessage, targetSession: ChatSession) {
395 get().updateTargetSession(targetSession, (session) => {

Callers

nothing calls this directly

Calls 2

getFunction · 0.70
setFunction · 0.50

Tested by

no test coverage detected