Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Read storage on window.onstorage (#7137)

authored by

dan and committed by
GitHub
20d4266e c9e42976

+12
+12
src/state/persisted/index.web.ts
··· 24 24 25 25 export async function init() { 26 26 broadcast.onmessage = onBroadcastMessage 27 + window.onstorage = onStorage 27 28 const stored = readFromStorage() 28 29 if (stored) { 29 30 _state = stored ··· 89 90 } 90 91 } 91 92 clearStorage satisfies PersistedApi['clearStorage'] 93 + 94 + function onStorage() { 95 + const next = readFromStorage() 96 + if (next === _state) { 97 + return 98 + } 99 + if (next) { 100 + _state = next 101 + _emitter.emit('update') 102 + } 103 + } 92 104 93 105 async function onBroadcastMessage({data}: MessageEvent) { 94 106 if (