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:
parent
1a834c29c6
commit
1c654db9ed
@ -12,10 +12,7 @@ export default class SupportPageMainExtension extends LensMainExtension {
|
|||||||
parentId: "help",
|
parentId: "help",
|
||||||
label: "Support",
|
label: "Support",
|
||||||
click() {
|
click() {
|
||||||
windowManager.navigate({
|
windowManager.navigate(supportPageURL());
|
||||||
channel: "menu:navigate", // fixme: use windowManager.ensureMainWindow from Tray's PR
|
|
||||||
url: supportPageURL(),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import * as Util from "./utils"
|
|||||||
import * as Registry from "../registries"
|
import * as Registry from "../registries"
|
||||||
import * as ClusterFeature from "./cluster-feature"
|
import * as ClusterFeature from "./cluster-feature"
|
||||||
|
|
||||||
|
// TODO: allow to expose windowManager.navigate() as Navigation.navigate() in runtime
|
||||||
export let windowManager: WindowManager;
|
export let windowManager: WindowManager;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|||||||
@ -50,8 +50,7 @@ export function buildMenu(windowManager: WindowManager) {
|
|||||||
|
|
||||||
async function navigate(url: string) {
|
async function navigate(url: string) {
|
||||||
logger.info(`[MENU]: navigating to ${url}`);
|
logger.info(`[MENU]: navigating to ${url}`);
|
||||||
await windowManager.ensureMainWindow();
|
await windowManager.navigate(url);
|
||||||
windowManager.navigate(url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const macAppMenu: MenuItemConstructorOptions = {
|
const macAppMenu: MenuItemConstructorOptions = {
|
||||||
|
|||||||
@ -43,8 +43,6 @@ export function initTray(windowManager: WindowManager) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function buildTray(icon: string | NativeImage, menu: Menu) {
|
export function buildTray(icon: string | NativeImage, menu: Menu) {
|
||||||
logger.info("[TRAY]: build start");
|
|
||||||
|
|
||||||
if (!tray) {
|
if (!tray) {
|
||||||
tray = new Tray(icon)
|
tray = new Tray(icon)
|
||||||
tray.setToolTip(packageInfo.description)
|
tray.setToolTip(packageInfo.description)
|
||||||
@ -76,8 +74,7 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Preferences",
|
label: "Preferences",
|
||||||
async click() {
|
click() {
|
||||||
await windowManager.ensureMainWindow()
|
|
||||||
windowManager.navigate(preferencesURL());
|
windowManager.navigate(preferencesURL());
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -98,7 +95,6 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
|
|||||||
async click() {
|
async click() {
|
||||||
workspaceStore.setActive(workspace);
|
workspaceStore.setActive(workspace);
|
||||||
clusterStore.setActive(clusterId);
|
clusterStore.setActive(clusterId);
|
||||||
await windowManager.ensureMainWindow()
|
|
||||||
windowManager.navigate(clusterViewURL({ params: { clusterId } }));
|
windowManager.navigate(clusterViewURL({ params: { clusterId } }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,8 +106,8 @@ export function createTrayMenu(windowManager: WindowManager): Menu {
|
|||||||
label: "Check for updates",
|
label: "Check for updates",
|
||||||
async click() {
|
async click() {
|
||||||
const result = await AppUpdater.checkForUpdates();
|
const result = await AppUpdater.checkForUpdates();
|
||||||
const browserWindow = await windowManager.ensureMainWindow();
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
const browserWindow = await windowManager.ensureMainWindow();
|
||||||
dialog.showMessageBoxSync(browserWindow, {
|
dialog.showMessageBoxSync(browserWindow, {
|
||||||
message: "No updates available",
|
message: "No updates available",
|
||||||
type: "info",
|
type: "info",
|
||||||
|
|||||||
@ -117,7 +117,8 @@ export class WindowManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(url: string, frameId?: number) {
|
async navigate(url: string, frameId?: number) {
|
||||||
|
await this.ensureMainWindow();
|
||||||
this.sendToView({
|
this.sendToView({
|
||||||
channel: "menu:navigate",
|
channel: "menu:navigate",
|
||||||
frameId: frameId,
|
frameId: frameId,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user