diff --git a/frontend/src/components/Details/DeleteAssets.vue b/frontend/src/components/Details/DeleteAssets.vue
index 611072e37..9b93db4fd 100644
--- a/frontend/src/components/Details/DeleteAssets.vue
+++ b/frontend/src/components/Details/DeleteAssets.vue
@@ -99,7 +99,7 @@ function closeDialog() {
- Cancel
+ Cancel
Confirm
diff --git a/frontend/src/components/Dialog/Platform/CreatePlatformBinding.vue b/frontend/src/components/Dialog/Platform/CreatePlatformBinding.vue
index 382179c55..c9f217578 100644
--- a/frontend/src/components/Dialog/Platform/CreatePlatformBinding.vue
+++ b/frontend/src/components/Dialog/Platform/CreatePlatformBinding.vue
@@ -8,6 +8,11 @@ const emitter = inject>("emitter");
emitter?.on("showCreatePlatformBindingDialog", () => {
show.value = true;
});
+
+// Functions
+function closeDialog() {
+ show.value = false;
+}
@@ -19,7 +24,7 @@ emitter?.on("showCreatePlatformBindingDialog", () => {
{
- Cancel
+ Cancel
Create
diff --git a/frontend/src/components/Dialog/Platform/DeletePlatform.vue b/frontend/src/components/Dialog/Platform/DeletePlatform.vue
index cbcf386c1..580c7a3a1 100644
--- a/frontend/src/components/Dialog/Platform/DeletePlatform.vue
+++ b/frontend/src/components/Dialog/Platform/DeletePlatform.vue
@@ -51,7 +51,11 @@ function closeDialog() {
}
-
+
@@ -60,7 +64,7 @@ function closeDialog() {
Do you confirm?
- Cancel
+ Cancel
-
+
@@ -32,7 +43,7 @@ function removeBindPlatform() {
Do you confirm?
- Cancel
+ Cancel
@@ -82,7 +82,7 @@ function closeDialog() {
- Cancel
+ Cancel
Confirm
diff --git a/frontend/src/components/Dialog/Rom/EditRom.vue b/frontend/src/components/Dialog/Rom/EditRom.vue
index 1ee0bfc43..72a7aba41 100644
--- a/frontend/src/components/Dialog/Rom/EditRom.vue
+++ b/frontend/src/components/Dialog/Rom/EditRom.vue
@@ -22,6 +22,7 @@ emitter?.on("showEditRomDialog", (romToEdit) => {
rom.value = romToEdit;
});
+// Functions
async function updateRom() {
if (!rom.value) return;
@@ -65,6 +66,10 @@ async function updateRom() {
emitter?.emit("showLoadingDialog", { loading: false, scrim: false });
});
}
+
+function closeDialog() {
+ show.value = false;
+}
@@ -73,8 +78,8 @@ async function updateRom() {
scroll-strategy="none"
width="auto"
:scrim="false"
- @click:outside="show = false"
- @keydown.esc="show = false"
+ @click:outside="closeDialog"
+ @keydown.esc="closeDialog"
no-click-animation
persistent
v-if="rom"
@@ -94,7 +99,7 @@ async function updateRom() {
- Cancel
+ Cancel
Apply
diff --git a/frontend/src/components/Dialog/Rom/SearchRom.vue b/frontend/src/components/Dialog/Rom/SearchRom.vue
index cf7c97837..4d3eba83b 100644
--- a/frontend/src/components/Dialog/Rom/SearchRom.vue
+++ b/frontend/src/components/Dialog/Rom/SearchRom.vue
@@ -27,6 +27,7 @@ emitter?.on("showSearchRomDialog", (romToSearch) => {
searchIGDB();
});
+// Functions
async function searchIGDB() {
if (!rom.value) return;
@@ -85,6 +86,10 @@ async function updateRom(matchedRom: IGDBRomType) {
});
}
+function closeDialog() {
+ show.value = false;
+}
+
onBeforeUnmount(() => {
emitter?.off("showSearchRomDialog");
});
@@ -96,8 +101,8 @@ onBeforeUnmount(() => {
scroll-strategy="none"
width="auto"
:scrim="false"
- @click:outside="show = false"
- @keydown.esc="show = false"
+ @click:outside="closeDialog"
+ @keydown.esc="closeDialog"
no-click-animation
persistent
>
@@ -148,7 +153,7 @@ onBeforeUnmount(() => {
{
socket.disconnect();
});
+// Functions
async function uploadRoms() {
show.value = false;
scanning.set(true);
@@ -97,6 +98,10 @@ async function uploadRoms() {
});
}
+function closeDialog() {
+ show.value = false;
+}
+
onBeforeUnmount(() => {
socket.off("scan:done");
socket.off("scan:done_ko");
@@ -109,8 +114,8 @@ onBeforeUnmount(() => {
scroll-strategy="none"
width="auto"
:scrim="false"
- @click:outside="show = false"
- @keydown.esc="show = false"
+ @click:outside="closeDialog"
+ @keydown.esc="closeDialog"
no-click-animation
persistent
>
@@ -129,7 +134,7 @@ onBeforeUnmount(() => {
{
/>
- Cancel
+ Cancel
Upload
diff --git a/frontend/src/components/Dialog/User/CreateUser.vue b/frontend/src/components/Dialog/User/CreateUser.vue
index fc853424e..e29c8ba7b 100644
--- a/frontend/src/components/Dialog/User/CreateUser.vue
+++ b/frontend/src/components/Dialog/User/CreateUser.vue
@@ -19,6 +19,7 @@ emitter?.on("showCreateUserDialog", () => {
show.value = true;
});
+// Functions
async function createUser() {
await api.createUser(user.value)
.then(({ data }) => {
@@ -35,6 +36,10 @@ async function createUser() {
});
show.value = false;
}
+
+function closeDialog() {
+ show.value = false;
+}
@@ -46,7 +51,7 @@ async function createUser() {
- Cancel
+ Cancel
{
show.value = true;
});
+// Functions
async function deleteUser() {
if (!user.value) return;
- await api.deleteUser(user.value)
+ await api
+ .deleteUser(user.value)
.then(() => {
if (user.value) usersStore.remove(user.value.id);
})
@@ -34,9 +36,21 @@ async function deleteUser() {
show.value = false;
}
+
+function closeDialog() {
+ show.value = false;
+}
-
+
@@ -45,7 +59,7 @@ async function deleteUser() {
+
Deleting{{ user.username }}.Do you confirm?
+ >user. Do you confirm?
- Cancel
+ Cancel
Confirm
diff --git a/frontend/src/components/Dialog/User/EditUser.vue b/frontend/src/components/Dialog/User/EditUser.vue
index 4b994a265..e87254331 100644
--- a/frontend/src/components/Dialog/User/EditUser.vue
+++ b/frontend/src/components/Dialog/User/EditUser.vue
@@ -4,7 +4,7 @@ import type { Emitter } from "mitt";
import type { Events, UserItem } from "@/types/emitter";
import api from "@/services/api";
-import { defaultAvatarPath } from "@/utils"
+import { defaultAvatarPath } from "@/utils";
import storeUsers from "@/stores/users";
const user = ref(null);
@@ -17,16 +17,18 @@ emitter?.on("showEditUserDialog", (userToEdit) => {
show.value = true;
});
+// Functions
function editUser() {
if (!user.value) return;
- api.updateUser(user.value)
+ api
+ .updateUser(user.value)
.then(({ data }) => {
emitter?.emit("snackbarShow", {
msg: `User ${data.username} updated successfully`,
icon: "mdi-check-bold",
color: "green",
- timeout: 5000
+ timeout: 5000,
});
usersStore.update(data);
})
@@ -37,13 +39,17 @@ function editUser() {
}`,
icon: "mdi-close-circle",
color: "red",
- timeout: 5000
+ timeout: 5000,
});
});
show.value = false;
emitter?.emit("refreshDrawer", null);
}
+
+function closeDialog() {
+ show.value = false;
+}
@@ -55,7 +61,7 @@ function editUser() {
- Cancel
+ Cancel
Apply
diff --git a/frontend/src/components/Notification.vue b/frontend/src/components/Notification.vue
index 4cba72bd2..0118a90ba 100644
--- a/frontend/src/components/Notification.vue
+++ b/frontend/src/components/Notification.vue
@@ -4,20 +4,24 @@ import type { Emitter } from "mitt";
import type { SnackbarStatus, Events } from "@/types/emitter";
// Props
-const snackbarShow = ref(false);
+const show = ref(false);
const snackbarStatus = ref({ msg: "" });
// Event listeners bus
const emitter = inject>("emitter");
emitter?.on("snackbarShow", (snackbar: SnackbarStatus) => {
- snackbarShow.value = true;
+ show.value = true;
snackbarStatus.value = snackbar;
});
+
+function closeDialog() {
+ show.value = false;
+}
{
/>
{{ snackbarStatus.msg }}
-
+