Add persistent state provider (#1830)
* Add persistent state provider * Catch write error * Handle read errors, update error msgs * Fix lint * Don't provide initial state to loader * Remove colorMode from shell state * Idea: hook into persisted context from other files * Migrate settings to new hook * Rework persisted state to split individual contexts * Tweak persisted schema and validation --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
parent
bfe196bac5
commit
96d8faf4b0
13 changed files with 467 additions and 76 deletions
|
|
@ -74,7 +74,6 @@ export class RootStoreModel {
|
|||
session: this.session.serialize(),
|
||||
me: this.me.serialize(),
|
||||
onboarding: this.onboarding.serialize(),
|
||||
shell: this.shell.serialize(),
|
||||
preferences: this.preferences.serialize(),
|
||||
invitedUsers: this.invitedUsers.serialize(),
|
||||
mutedThreads: this.mutedThreads.serialize(),
|
||||
|
|
@ -99,9 +98,6 @@ export class RootStoreModel {
|
|||
if (hasProp(v, 'session')) {
|
||||
this.session.hydrate(v.session)
|
||||
}
|
||||
if (hasProp(v, 'shell')) {
|
||||
this.shell.hydrate(v.shell)
|
||||
}
|
||||
if (hasProp(v, 'preferences')) {
|
||||
this.preferences.hydrate(v.preferences)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue