fix: navigation via menu

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman authored and Sebastian Malton committed 2020-07-27 09:14:16 -04:00
1 parent 8f3730157b
commit 9ba5025a0b
1 file changed
+2 -2
+2 -2
View File
@@ -12,7 +12,7 @@ import logger from "./logger";
export function initMenu(windowManager: WindowManager) { export function initMenu(windowManager: WindowManager) {
autorun(() => { autorun(() => {
logger.debug(`[MENU]: refreshing menu, cluster=${clusterStore.activeClusterId}`); logger.debug(`[MENU]: building menu, cluster=${clusterStore.activeClusterId}`);
buildMenu(windowManager); buildMenu(windowManager);
}); });
} }
@@ -20,9 +20,9 @@ export function initMenu(windowManager: WindowManager) {
function buildMenu(windowManager: WindowManager) { function buildMenu(windowManager: WindowManager) {
const hasClusters = clusterStore.hasClusters(); const hasClusters = clusterStore.hasClusters();
const activeClusterId = clusterStore.activeClusterId; const activeClusterId = clusterStore.activeClusterId;
const clusterView = windowManager.getClusterView(activeClusterId);
function navigate(url: string) { function navigate(url: string) {
const clusterView = windowManager.getClusterView(activeClusterId);
broadcastIpc({ broadcastIpc({
channel: "menu:navigate", channel: "menu:navigate",
webContentId: clusterView ? clusterView.id : undefined /*no-clusters*/, webContentId: clusterView ? clusterView.id : undefined /*no-clusters*/,