diff --git a/ui/components/Settings.vue b/ui/components/Settings.vue index cf64c3da..184196c5 100644 --- a/ui/components/Settings.vue +++ b/ui/components/Settings.vue @@ -12,7 +12,7 @@
- +
- +
+ +
+ +
+
+ +
+
+
+ +
+ +
+ + +
+
+
@@ -103,10 +131,9 @@
- diff --git a/ui/composables/useNotification.ts b/ui/composables/useNotification.ts index 1e5872e9..dda3f462 100644 --- a/ui/composables/useNotification.ts +++ b/ui/composables/useNotification.ts @@ -1,13 +1,17 @@ import { useStorage } from '@vueuse/core' -import { useToast } from "vue-toastification" +import { POSITION, useToast } from "vue-toastification" type notificationType = 'info' | 'success' | 'warning' | 'error' type notificationOptions = { timeout?: number, force?: boolean, + closeOnClick?: boolean, + position?: POSITION } const allowToast = useStorage('allow_toasts', true) +const toastPosition = useStorage('toast_position', POSITION.TOP_RIGHT) +const toastDismissOnClick = useStorage('toast_dismiss_on_click', true) const toast = useToast() function notify(type: notificationType, message: string, opts?: notificationOptions): void { @@ -20,6 +24,13 @@ function notify(type: notificationType, message: string, opts?: notificationOpti opts = {} } + if (opts?.force) { + delete opts.force + } + + opts.closeOnClick = toastDismissOnClick.value + opts.position = toastPosition.value ?? POSITION.TOP_RIGHT + switch (type) { case 'info': toast.info(message, opts)