feat: 添加托盘最小化通知;禁用 F12 键事件监听

This commit is contained in:
2025-04-09 11:24:00 +08:00
parent 364d38ddc0
commit 6687888c97
3 changed files with 143 additions and 134 deletions

View File

@@ -33,6 +33,12 @@ export async function initAll(isOnBoot: boolean) {
if (setting.settings.bootAsMinimized && !isDev) {
const appWindow = getCurrentWindow();
appWindow.hide();
sendNotification({
title: "VTsuru.Client",
body: '已启动并最小化到托盘',
silent: false,
extra: { type: 'question-box' },
});
}
}
let permissionGranted = await isPermissionGranted();
@@ -113,6 +119,16 @@ export async function initAll(isOnBoot: boolean) {
appWindow.setMinSize(new PhysicalSize(720, 480));
// 监听f12事件
if (!isDev) {
window.addEventListener('keydown', (event) => {
if (event.key === 'F12') {
event.preventDefault();
event.stopPropagation();
}
});
}
clientInited.value = true;
}
export function OnClientUnmounted() {