diff options
Diffstat (limited to 'src/lib/Menu.js')
-rw-r--r-- | src/lib/Menu.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 75f2efbea..3b02273ed 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -116,6 +116,7 @@ const template = [ | |||
116 | 116 | ||
117 | export default class FranzMenu { | 117 | export default class FranzMenu { |
118 | @observable tpl = template; | 118 | @observable tpl = template; |
119 | @observable template = null; | ||
119 | 120 | ||
120 | constructor(stores, actions) { | 121 | constructor(stores, actions) { |
121 | this.stores = stores; | 122 | this.stores = stores; |
@@ -124,12 +125,12 @@ export default class FranzMenu { | |||
124 | autorun(this._build.bind(this)); | 125 | autorun(this._build.bind(this)); |
125 | } | 126 | } |
126 | 127 | ||
127 | @computed get template() { | 128 | get template() { |
128 | return toJS(this.tpl); | 129 | return this.template; |
129 | } | 130 | } |
130 | 131 | ||
131 | _build() { | 132 | _build() { |
132 | const tpl = this.template; | 133 | const tpl = toJS(this.tpl); |
133 | 134 | ||
134 | tpl[1].submenu.push({ | 135 | tpl[1].submenu.push({ |
135 | role: 'toggledevtools', | 136 | role: 'toggledevtools', |
@@ -252,6 +253,7 @@ export default class FranzMenu { | |||
252 | tpl[isMac ? 3 : 2].submenu = toJS(this.serviceTpl); | 253 | tpl[isMac ? 3 : 2].submenu = toJS(this.serviceTpl); |
253 | } | 254 | } |
254 | 255 | ||
256 | this.template = tpl; | ||
255 | const menu = Menu.buildFromTemplate(tpl); | 257 | const menu = Menu.buildFromTemplate(tpl); |
256 | Menu.setApplicationMenu(menu); | 258 | Menu.setApplicationMenu(menu); |
257 | } | 259 | } |