remove constant and import, it is type safe as is #7730

This commit is contained in:
contributor 2025-11-14 11:33:50 +02:00
parent d69dd2a83f
commit ef86e195c6

View File

@ -6,7 +6,6 @@ import optionService from "./options.js";
import log from "./log.js"; import log from "./log.js";
import sqlInit from "./sql_init.js"; import sqlInit from "./sql_init.js";
import cls from "./cls.js"; import cls from "./cls.js";
import { KeyboardActionNames } from "@triliumnext/commons";
import keyboardActionsService from "./keyboard_actions.js"; import keyboardActionsService from "./keyboard_actions.js";
import electron from "electron"; import electron from "electron";
import type { App, BrowserWindowConstructorOptions, BrowserWindow, WebContents, IpcMainEvent } from "electron"; import type { App, BrowserWindowConstructorOptions, BrowserWindow, WebContents, IpcMainEvent } from "electron";
@ -320,7 +319,6 @@ function closeSetupWindow() {
} }
async function registerGlobalShortcuts() { async function registerGlobalShortcuts() {
const toggleTrayAction: KeyboardActionNames = "toggleTray";
const { globalShortcut } = await import("electron"); const { globalShortcut } = await import("electron");
await sqlInit.dbReady; await sqlInit.dbReady;
@ -344,7 +342,7 @@ async function registerGlobalShortcuts() {
return; return;
} }
if (action.actionName === toggleTrayAction) { if (action.actionName === "toggleTray") {
targetWindow.focus(); targetWindow.focus();
} else { } else {
showAndFocusWindow(targetWindow); showAndFocusWindow(targetWindow);