From 72d4164030bdf7c596a482b1a56b2afec94d181a Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Wed, 28 Nov 2018 20:48:18 +0100 Subject: [PATCH] fix(App): App menu was not initialized on app launch. Resolving copy & paste issues for login. --- src/lib/Menu.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 76b0f28d5..9d7df551c 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -485,7 +485,9 @@ export default class FranzMenu { this.stores = stores; this.actions = actions; - autorun(this._build.bind(this)); + setTimeout(() => { + autorun(this._build.bind(this)); + }, 10); } rebuild() { @@ -497,7 +499,6 @@ export default class FranzMenu { } _build() { - // console.log(window.franz); const serviceTpl = Object.assign([], this.serviceTpl); // need to clone object so we don't modify computed (cached) object if (window.franz === undefined) { @@ -521,6 +522,7 @@ export default class FranzMenu { click: () => { this.actions.service.openDevToolsForActiveService(); }, + enabled: this.stores.user.isLoggedIn && this.stores.services.enabled.length > 0, }); tpl[1].submenu.unshift({ @@ -559,6 +561,7 @@ export default class FranzMenu { click: () => { this.actions.ui.openSettings({ path: 'app' }); }, + enabled: this.stores.user.isLoggedIn, }, { type: 'separator', @@ -640,6 +643,7 @@ export default class FranzMenu { click: () => { this.actions.ui.openSettings({ path: 'app' }); }, + enabled: this.stores.user.isLoggedIn, }, { type: 'separator', @@ -661,6 +665,7 @@ export default class FranzMenu { click: () => { this.actions.ui.openSettings({ path: 'recipes' }); }, + enabled: this.stores.user.isLoggedIn, }, { type: 'separator', });