From 43acb4145e0d19ec9a28a59583510499af624fb7 Mon Sep 17 00:00:00 2001 From: Ricardo Cino Date: Mon, 27 Jun 2022 00:02:24 +0200 Subject: feat: remember collapsed state of hamburger menu on refresh/reboot (#373) --- src/stores/AppStore.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/stores/AppStore.ts') 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 { this.actions.app.healthCheck.listen(this._healthCheck.bind(this)); this.actions.app.muteApp.listen(this._muteApp.bind(this)); this.actions.app.toggleMuteApp.listen(this._toggleMuteApp.bind(this)); + this.actions.app.toggleCollapseMenu.listen( + this._toggleCollapseMenu.bind(this), + ); this.actions.app.clearAllCache.listen(this._clearAllCache.bind(this)); this.registerReactions([ @@ -449,6 +452,15 @@ export default class AppStore extends TypedStore { }); } + @action _toggleCollapseMenu(): void { + this.actions.settings.update({ + type: 'app', + data: { + isMenuCollapsed: !this.stores.settings.all.app.isMenuCollapsed, + }, + }); + } + @action async _clearAllCache() { this.isClearingAllCache = true; const clearAppCache = this.clearAppCacheRequest.execute(); -- cgit v1.2.3-54-g00ecf