1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix: navigation via menu

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-07-24 17:02:28 +03:00
parent 7a814635e1
commit 78a9fcde56

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*/,