mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-11 02:59:13 +00:00
Set state to loaded if it crashes while loading.
This commit is contained in:
parent
1ea19dcf1d
commit
40b607bdea
1 changed files with 16 additions and 11 deletions
|
@ -38,6 +38,7 @@ export default function createPersistedState ({
|
|||
} = {}) {
|
||||
return store => {
|
||||
getState(key, storage).then((savedState) => {
|
||||
try {
|
||||
if (typeof savedState === 'object') {
|
||||
// build user cache
|
||||
const usersState = savedState.users || {}
|
||||
|
@ -51,6 +52,10 @@ export default function createPersistedState ({
|
|||
)
|
||||
}
|
||||
loaded = true
|
||||
} catch (e) {
|
||||
console.log("Couldn't load state")
|
||||
loaded = true
|
||||
}
|
||||
})
|
||||
|
||||
subscriber(store)((mutation, state) => {
|
||||
|
|
Loading…
Reference in a new issue