MCPcopy Create free account
hub / github.com/ChatGPTBox-dev/chatGPTBox / updateSession

Function updateSession

src/services/local-session.mjs:55–63  ·  view source on GitHub ↗
(newSession)

Source from the content-addressed store, hash-verified

53}
54
55export const updateSession = async (newSession) => {
56 newSession.updatedAt = new Date().toISOString()
57 const currentSessions = await getSessions()
58 currentSessions[
59 currentSessions.findIndex((session) => session.sessionId === newSession.sessionId)
60 ] = newSession
61 await Browser.storage.local.set({ sessions: currentSessions })
62 return currentSessions
63}
64
65export const resetSessions = async () => {
66 const currentSessions = [await initDefaultSession()]

Callers 2

AppFunction · 0.90

Calls 1

getSessionsFunction · 0.85

Tested by

no test coverage detected