chore: fix lint and typecheck issues

This commit is contained in:
xingyu4j
2026-03-13 20:57:52 +08:00
parent 771277d5d9
commit a850d426ef
26 changed files with 306 additions and 155 deletions

View File

@@ -53,11 +53,13 @@ function handleClose() {
const keys = useMagicKeys();
const cmd = isWindowsOs() ? keys['ctrl+k'] : keys['cmd+k'];
whenever(cmd!, () => {
if (props.enableShortcutKey) {
modalApi.open();
}
});
if (cmd) {
whenever(cmd, () => {
if (props.enableShortcutKey) {
modalApi.open();
}
});
}
whenever(open, () => {
nextTick(() => {
@@ -80,6 +82,7 @@ const toggleKeydownListener = () => {
};
const toggleOpen = () => {
// oxlint-disable-next-line no-unused-expressions
open.value ? modalApi.close() : modalApi.open();
};

View File

@@ -153,17 +153,24 @@ function handleSubmitLogout() {
if (enableShortcutKey.value) {
const keys = useMagicKeys();
whenever(keys['Alt+KeyQ']!, () => {
if (enableLogoutShortcutKey.value) {
handleLogout();
}
});
const logoutKey = keys['Alt+KeyQ'];
const lockKey = keys['Alt+KeyL'];
whenever(keys['Alt+KeyL']!, () => {
if (enableLockScreenShortcutKey.value) {
handleOpenLock();
}
});
if (logoutKey) {
whenever(logoutKey, () => {
if (enableLogoutShortcutKey.value) {
handleLogout();
}
});
}
if (lockKey) {
whenever(lockKey, () => {
if (enableLockScreenShortcutKey.value) {
handleOpenLock();
}
});
}
}
</script>