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

Function deleteSession

src/services/local-session.mjs:36–45  ·  view source on GitHub ↗
(sessionId)

Source from the content-addressed store, hash-verified

34}
35
36export const deleteSession = async (sessionId) => {
37 const currentSessions = await getSessions()
38 const index = currentSessions.findIndex((session) => session.sessionId === sessionId)
39 currentSessions.splice(index, 1)
40 if (currentSessions.length > 0) {
41 await Browser.storage.local.set({ sessions: currentSessions })
42 return currentSessions
43 }
44 return await resetSessions()
45}
46
47export const getSession = async (sessionId) => {
48 const currentSessions = await getSessions()

Callers 2

AppFunction · 0.90

Calls 2

getSessionsFunction · 0.85
resetSessionsFunction · 0.85

Tested by

no test coverage detected