diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-06-27 00:02:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-26 22:02:24 +0000 |
commit | 43acb4145e0d19ec9a28a59583510499af624fb7 (patch) | |
tree | b6e0a17424b936f9478c41785c2cdee208d50d26 /src/stores | |
parent | chore: turned all auth containers into typescript (#375) (diff) | |
download | ferdium-app-43acb4145e0d19ec9a28a59583510499af624fb7.tar.gz ferdium-app-43acb4145e0d19ec9a28a59583510499af624fb7.tar.zst ferdium-app-43acb4145e0d19ec9a28a59583510499af624fb7.zip |
feat: remember collapsed state of hamburger menu on refresh/reboot (#373)
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index f333a0060..05acbf33d 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -114,6 +114,9 @@ export default class AppStore extends TypedStore { | |||
114 | this.actions.app.healthCheck.listen(this._healthCheck.bind(this)); | 114 | this.actions.app.healthCheck.listen(this._healthCheck.bind(this)); |
115 | this.actions.app.muteApp.listen(this._muteApp.bind(this)); | 115 | this.actions.app.muteApp.listen(this._muteApp.bind(this)); |
116 | this.actions.app.toggleMuteApp.listen(this._toggleMuteApp.bind(this)); | 116 | this.actions.app.toggleMuteApp.listen(this._toggleMuteApp.bind(this)); |
117 | this.actions.app.toggleCollapseMenu.listen( | ||
118 | this._toggleCollapseMenu.bind(this), | ||
119 | ); | ||
117 | this.actions.app.clearAllCache.listen(this._clearAllCache.bind(this)); | 120 | this.actions.app.clearAllCache.listen(this._clearAllCache.bind(this)); |
118 | 121 | ||
119 | this.registerReactions([ | 122 | this.registerReactions([ |
@@ -449,6 +452,15 @@ export default class AppStore extends TypedStore { | |||
449 | }); | 452 | }); |
450 | } | 453 | } |
451 | 454 | ||
455 | @action _toggleCollapseMenu(): void { | ||
456 | this.actions.settings.update({ | ||
457 | type: 'app', | ||
458 | data: { | ||
459 | isMenuCollapsed: !this.stores.settings.all.app.isMenuCollapsed, | ||
460 | }, | ||
461 | }); | ||
462 | } | ||
463 | |||
452 | @action async _clearAllCache() { | 464 | @action async _clearAllCache() { |
453 | this.isClearingAllCache = true; | 465 | this.isClearingAllCache = true; |
454 | const clearAppCache = this.clearAppCacheRequest.execute(); | 466 | const clearAppCache = this.clearAppCacheRequest.execute(); |