mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 09:56:36 +01:00
@@ -6,6 +6,7 @@ import openService from "../services/open.js";
|
||||
import protectedSessionService from "../services/protected_session.js";
|
||||
import options from "../services/options.js";
|
||||
import froca from "../services/froca.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
export default class RootCommandExecutor extends Component {
|
||||
editReadOnlyNoteCommand() {
|
||||
@@ -155,6 +156,15 @@ export default class RootCommandExecutor extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
toggleTrayCommand() {
|
||||
if (!utils.isElectron()) return;
|
||||
const {BrowserWindow} = utils.dynamicRequire('@electron/remote');
|
||||
const windows = BrowserWindow.getAllWindows();
|
||||
const isVisible = windows.every(w => w.isVisible());
|
||||
const action = isVisible ? "hide" : "show"
|
||||
for (const window of windows) window[action]();
|
||||
}
|
||||
|
||||
firstTabCommand() { this.#goToTab(1); }
|
||||
secondTabCommand() { this.#goToTab(2); }
|
||||
thirdTabCommand() { this.#goToTab(3); }
|
||||
|
||||
Reference in New Issue
Block a user