Fix a bug with null session key

This commit is contained in:
Jon Staab 2023-12-18 12:00:01 -08:00
parent 22b275dd20
commit af37501ec1

View File

@ -55,4 +55,10 @@ export const publishSettings = async (updates: Record<string, any>) => {
export const updateSession = (k, f) => sessions.update($s => ({...$s, [k]: f($s[k])}))
export const updateCurrentSession = f => updateSession(pubkey.get(), f)
export const updateCurrentSession = f => {
const $pubkey = pubkey.get()
if ($pubkey) {
updateSession($pubkey, f)
}
}