From c13c4427a7b772ff59e261649d7965554b19b83c Mon Sep 17 00:00:00 2001 From: arabcoders Date: Tue, 3 Jun 2025 17:44:23 +0300 Subject: [PATCH] Proxy our toast usage via our own methods to be able to control enabling/disabling it. --- ui/assets/css/style.css | 5 +++- ui/components/ConditionForm.vue | 2 +- ui/components/FloatingImage.vue | 2 +- ui/components/GetInfo.vue | 2 +- ui/components/History.vue | 2 +- ui/components/ImageView.vue | 2 +- ui/components/NewDownload.vue | 2 +- ui/components/NotificationForm.vue | 2 +- ui/components/PresetForm.vue | 2 +- ui/components/TaskForm.vue | 2 +- ui/components/VideoPlayer.vue | 2 +- ui/composables/useNotification.ts | 47 ++++++++++++++++++++++++++++++ ui/composables/useToast.js | 2 -- ui/pages/browser/[...slug].vue | 2 +- ui/pages/conditions.vue | 2 +- ui/pages/logs.vue | 2 +- ui/pages/notifications.vue | 2 +- ui/pages/presets.vue | 2 +- ui/pages/tasks.vue | 2 +- ui/stores/SocketStore.js | 2 +- ui/utils/index.js | 4 +-- 21 files changed, 69 insertions(+), 23 deletions(-) create mode 100644 ui/composables/useNotification.ts delete mode 100644 ui/composables/useToast.js diff --git a/ui/assets/css/style.css b/ui/assets/css/style.css index 1894c280..fb8781d3 100644 --- a/ui/assets/css/style.css +++ b/ui/assets/css/style.css @@ -325,7 +325,10 @@ hr { white-space: nowrap; } - .is-max-width { max-width: calc(100% - 10px); } + +.is-bold { + font-weight: bold; +} diff --git a/ui/components/ConditionForm.vue b/ui/components/ConditionForm.vue index 144940c6..665b3d8c 100644 --- a/ui/components/ConditionForm.vue +++ b/ui/components/ConditionForm.vue @@ -149,7 +149,7 @@ const props = defineProps({ }, }) -const toast = useToast() +const toast = useNotification() const form = reactive(JSON.parse(JSON.stringify(props.item))) const import_string = ref('') const showImport = useStorage('showImport', false); diff --git a/ui/components/FloatingImage.vue b/ui/components/FloatingImage.vue index 1ac1e289..2c346b57 100644 --- a/ui/components/FloatingImage.vue +++ b/ui/components/FloatingImage.vue @@ -43,7 +43,7 @@ const props = defineProps({ }); const cache = useSessionCache() -const toast = useToast() +const toast = useNotification() const url = ref() const error = ref(false) const isPreloading = ref(false) diff --git a/ui/components/GetInfo.vue b/ui/components/GetInfo.vue index 273312a9..5135dd2c 100644 --- a/ui/components/GetInfo.vue +++ b/ui/components/GetInfo.vue @@ -40,7 +40,7 @@ import { request } from '~/utils/index' const emitter = defineEmits(['closeModel']) const isLoading = ref(false) const data = ref({}) -const toast = useToast() +const toast = useNotification() const props = defineProps({ link: { diff --git a/ui/components/History.vue b/ui/components/History.vue index a5954de4..d77b90da 100644 --- a/ui/components/History.vue +++ b/ui/components/History.vue @@ -385,7 +385,7 @@ const emitter = defineEmits(['getInfo', 'add_new']) const config = useConfigStore() const stateStore = useStateStore() const socket = useSocketStore() -const toast = useToast() +const toast = useNotification() const selectedElms = ref([]) const masterSelectAll = ref(false) diff --git a/ui/components/ImageView.vue b/ui/components/ImageView.vue index 669316d0..8a5a22a4 100644 --- a/ui/components/ImageView.vue +++ b/ui/components/ImageView.vue @@ -23,7 +23,7 @@ import { request } from '~/utils/index' const emitter = defineEmits(['closeModel']) const isLoading = ref(false) const data = ref({}) -const toast = useToast() +const toast = useNotification() const image = ref('') const props = defineProps({ diff --git a/ui/components/NewDownload.vue b/ui/components/NewDownload.vue index 172a0d48..61a415a2 100644 --- a/ui/components/NewDownload.vue +++ b/ui/components/NewDownload.vue @@ -189,7 +189,7 @@ const props = defineProps({ const emitter = defineEmits(['getInfo', 'clear_form']) const config = useConfigStore() const socket = useSocketStore() -const toast = useToast() +const toast = useNotification() const showAdvanced = useStorage('show_advanced', false) const addInProgress = ref(false) diff --git a/ui/components/NotificationForm.vue b/ui/components/NotificationForm.vue index 87130c3f..90a9dcff 100644 --- a/ui/components/NotificationForm.vue +++ b/ui/components/NotificationForm.vue @@ -268,7 +268,7 @@