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

support page fixes

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-10-27 13:22:28 +02:00
parent 1a834c29c6
commit 1c654db9ed
5 changed files with 7 additions and 13 deletions

View File

@ -12,10 +12,7 @@ export default class SupportPageMainExtension extends LensMainExtension {
parentId: "help",
label: "Support",
click() {
windowManager.navigate({
channel: "menu:navigate", // fixme: use windowManager.ensureMainWindow from Tray's PR
url: supportPageURL(),
});
windowManager.navigate(supportPageURL());
}
})
)

View File

@ -12,6 +12,7 @@ import * as Util from "./utils"
import * as Registry from "../registries"
import * as ClusterFeature from "./cluster-feature"
// TODO: allow to expose windowManager.navigate() as Navigation.navigate() in runtime
export let windowManager: WindowManager;
export {

View File

@ -50,8 +50,7 @@ export function buildMenu(windowManager: WindowManager) {
async function navigate(url: string) {
logger.info(`[MENU]: navigating to ${url}`);
await windowManager.ensureMainWindow();
windowManager.navigate(url);
await windowManager.navigate(url);
}
const macAppMenu: MenuItemConstructorOptions = {

View File

@ -43,8 +43,6 @@ export function initTray(windowManager: WindowManager) {
}
export function buildTray(icon: string | NativeImage, menu: Menu) {
logger.info("[TRAY]: build start");
if (!tray) {
tray = new Tray(icon)
tray.setToolTip(packageInfo.description)
@ -76,8 +74,7 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
},
{
label: "Preferences",
async click() {
await windowManager.ensureMainWindow()
click() {
windowManager.navigate(preferencesURL());
},
},
@ -98,7 +95,6 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
async click() {
workspaceStore.setActive(workspace);
clusterStore.setActive(clusterId);
await windowManager.ensureMainWindow()
windowManager.navigate(clusterViewURL({ params: { clusterId } }));
}
}
@ -110,8 +106,8 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
label: "Check for updates",
async click() {
const result = await AppUpdater.checkForUpdates();
const browserWindow = await windowManager.ensureMainWindow();
if (!result) {
const browserWindow = await windowManager.ensureMainWindow();
dialog.showMessageBoxSync(browserWindow, {
message: "No updates available",
type: "info",

View File

@ -117,7 +117,8 @@ export class WindowManager {
}
}
navigate(url: string, frameId?: number) {
async navigate(url: string, frameId?: number) {
await this.ensureMainWindow();
this.sendToView({
channel: "menu:navigate",
frameId: frameId,