(setStore: SetStoreFunction<State>, session: Session)
| 145 | } |
| 146 | |
| 147 | function mergeSession(setStore: SetStoreFunction<State>, session: Session) { |
| 148 | setStore("session", (list) => { |
| 149 | const next = list.slice() |
| 150 | const idx = next.findIndex((item) => item.id >= session.id) |
| 151 | if (idx === -1) return [...next, session] |
| 152 | if (next[idx]?.id === session.id) { |
| 153 | next[idx] = session |
| 154 | return next |
| 155 | } |
| 156 | next.splice(idx, 0, session) |
| 157 | return next |
| 158 | }) |
| 159 | } |
| 160 | |
| 161 | function warmSessions(input: { |
| 162 | ids: string[] |
no test coverage detected