(newSession)
| 53 | } |
| 54 | |
| 55 | export 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 | |
| 65 | export const resetSessions = async () => { |
| 66 | const currentSessions = [await initDefaultSession()] |
no test coverage detected