diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-08-04 00:12:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 23:12:03 +0000 |
commit | c2509e860752e23812bb408e331c02c918aadd54 (patch) | |
tree | b855163ad1bddaaa19c47a9cea2713c6899ea1a5 /src/lib | |
parent | Revert to older working version of 'macos-notification-state' (diff) | |
download | ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.tar.gz ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.tar.zst ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.zip |
chore: change values inside mobx actions to fix console warnings (#532)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 41b4aa9f7..b8826f12e 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -7,7 +7,7 @@ import { | |||
7 | systemPreferences, | 7 | systemPreferences, |
8 | getCurrentWindow, | 8 | getCurrentWindow, |
9 | } from '@electron/remote'; | 9 | } from '@electron/remote'; |
10 | import { autorun, makeObservable, observable } from 'mobx'; | 10 | import { autorun, action, makeObservable, observable } from 'mobx'; |
11 | import { defineMessages } from 'react-intl'; | 11 | import { defineMessages } from 'react-intl'; |
12 | import osName from 'os-name'; | 12 | import osName from 'os-name'; |
13 | import { fromJS } from 'immutable'; | 13 | import { fromJS } from 'immutable'; |
@@ -635,6 +635,10 @@ class FranzMenu { | |||
635 | }, 10); | 635 | }, 10); |
636 | } | 636 | } |
637 | 637 | ||
638 | @action _setCurrentTemplate(tpl) { | ||
639 | this.currentTemplate = tpl; | ||
640 | } | ||
641 | |||
638 | rebuild() { | 642 | rebuild() { |
639 | this._build(); | 643 | this._build(); |
640 | } | 644 | } |
@@ -989,7 +993,7 @@ class FranzMenu { | |||
989 | ...this.debugMenu(), | 993 | ...this.debugMenu(), |
990 | ); | 994 | ); |
991 | } | 995 | } |
992 | this.currentTemplate = tpl; | 996 | this._setCurrentTemplate(tpl); |
993 | const menu = Menu.buildFromTemplate(tpl); | 997 | const menu = Menu.buildFromTemplate(tpl); |
994 | Menu.setApplicationMenu(menu); | 998 | Menu.setApplicationMenu(menu); |
995 | } | 999 | } |