mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 21:24:05 +02:00
fix: back button not wroking on settings
This commit is contained in:
parent
e29f2fcfa5
commit
b3daaaa633
2 changed files with 36 additions and 23 deletions
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<div class="bg">
|
||||
<div class="back">
|
||||
<img @click="router.push('/')" src="../public/back_arrow.svg" />
|
||||
<NuxtLink to="/" class="back">
|
||||
<img src="../public/back_arrow.svg" />
|
||||
<p>Back</p>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
<div class="bottom-bar">
|
||||
<div class="left">
|
||||
<img alt="" class="logo" src="../public/logo.png" width="18px" />
|
||||
|
@ -154,29 +154,41 @@ const saveKeybind = async () => {
|
|||
onMounted(() => {
|
||||
os.value = platform();
|
||||
|
||||
keyboard.down("all", (event) => {
|
||||
const isMacSaveCombo =
|
||||
os.value === "macos" &&
|
||||
(event.code === "MetaLeft" || event.code === "MetaRight") &&
|
||||
event.key === "Enter";
|
||||
|
||||
const isOtherOsSaveCombo =
|
||||
os.value !== "macos" &&
|
||||
(event.code === "ControlLeft" || event.code === "ControlRight") &&
|
||||
event.key === "Enter";
|
||||
|
||||
if (
|
||||
(isMacSaveCombo || isOtherOsSaveCombo) &&
|
||||
!isKeybindInputFocused.value
|
||||
) {
|
||||
event.preventDefault();
|
||||
saveKeybind();
|
||||
keyboard.down("MetaLeft+Enter", (event) => {
|
||||
if (os.value === "macos" && !isKeybindInputFocused.value) {
|
||||
console.log("Save on macOS")
|
||||
event.preventDefault()
|
||||
saveKeybind()
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
keyboard.down("MetaRight+Enter", (event) => {
|
||||
if (os.value === "macos" && !isKeybindInputFocused.value) {
|
||||
console.log("Save on macOS")
|
||||
event.preventDefault()
|
||||
saveKeybind()
|
||||
}
|
||||
})
|
||||
|
||||
keyboard.down("ControlLeft+Enter", (event) => {
|
||||
if (os.value !== "macos" && !isKeybindInputFocused.value) {
|
||||
console.log("Save on other OS")
|
||||
event.preventDefault()
|
||||
saveKeybind()
|
||||
}
|
||||
})
|
||||
|
||||
keyboard.down("ControlRight+Enter", (event) => {
|
||||
if (os.value !== "macos" && !isKeybindInputFocused.value) {
|
||||
console.log("Save on other OS")
|
||||
event.preventDefault()
|
||||
saveKeybind()
|
||||
}
|
||||
})
|
||||
|
||||
keyboard.down("Escape", (event) => {
|
||||
const now = Date.now();
|
||||
if (!isKeybindInputFocused.value && now - lastBlurTime.value > 100) {
|
||||
console.log("Escape");
|
||||
if (!isKeybindInputFocused.value) {
|
||||
event.preventDefault();
|
||||
router.push("/");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue