From 210712cee2c909d8d2cb50a8f45929f5910c907d Mon Sep 17 00:00:00 2001 From: arabcoders Date: Tue, 21 Apr 2026 20:51:47 +0300 Subject: [PATCH] refactor: drop pinia stores --- ui/app/components/ConditionForm.vue | 2 +- ui/app/components/DLFieldForm.vue | 2 +- ui/app/components/NewDownload.vue | 2 +- ui/app/components/NotifyDropdown.vue | 3 +- ui/app/components/PresetForm.vue | 2 +- ui/app/components/SettingsPanel.vue | 3 +- ui/app/components/TaskForm.vue | 2 +- ui/app/components/TaskInspect.vue | 3 +- ui/app/components/VideoPlayer.vue | 2 +- ui/app/composables/useAppSocket.ts | 403 +++++++++++++ ui/app/composables/useBrowser.ts | 3 +- ui/app/composables/useNotification.ts | 5 +- ui/app/composables/useNotificationCenter.ts | 115 ++++ ui/app/composables/usePresetOptions.ts | 3 +- ui/app/composables/useYtpConfig.ts | 219 ++++++++ ui/app/layouts/default.vue | 10 +- ui/app/pages/browser/[...slug].vue | 24 +- ui/app/pages/changelog.vue | 2 +- ui/app/pages/conditions.vue | 11 +- ui/app/pages/console.vue | 2 +- ui/app/pages/dl_fields.vue | 11 +- ui/app/pages/logs.vue | 2 +- ui/app/pages/notifications.vue | 11 +- ui/app/pages/presets.vue | 2 +- ui/app/pages/tasks.vue | 6 +- ui/app/stores/ConfigStore.ts | 227 -------- ui/app/stores/NotificationStore.ts | 96 ---- ui/app/stores/SocketStore.ts | 404 ------------- ui/app/stores/StateStore.ts | 531 ------------------ ui/app/utils/index.ts | 40 -- ui/bun.lock | 106 ++-- ui/nuxt.config.ts | 3 +- ui/package.json | 2 - ui/tests/composables/usePresetOptions.test.ts | 24 +- ui/tests/utils/index.test.ts | 9 - 35 files changed, 871 insertions(+), 1421 deletions(-) create mode 100644 ui/app/composables/useAppSocket.ts create mode 100644 ui/app/composables/useNotificationCenter.ts create mode 100644 ui/app/composables/useYtpConfig.ts delete mode 100644 ui/app/stores/ConfigStore.ts delete mode 100644 ui/app/stores/NotificationStore.ts delete mode 100644 ui/app/stores/SocketStore.ts delete mode 100644 ui/app/stores/StateStore.ts diff --git a/ui/app/components/ConditionForm.vue b/ui/app/components/ConditionForm.vue index 871ca279..5f5f53c1 100644 --- a/ui/app/components/ConditionForm.vue +++ b/ui/app/components/ConditionForm.vue @@ -538,7 +538,7 @@ const props = defineProps<{ const toast = useNotification(); const showImport = useStorage('showImport', false); const box = useConfirm(); -const config = useConfigStore(); +const config = useYtpConfig(); const form = reactive(normalizeCondition(props.item)); const importString = ref(''); diff --git a/ui/app/components/DLFieldForm.vue b/ui/app/components/DLFieldForm.vue index 8b99971b..fef2847e 100644 --- a/ui/app/components/DLFieldForm.vue +++ b/ui/app/components/DLFieldForm.vue @@ -260,7 +260,7 @@ const props = defineProps<{ const toast = useNotification(); const box = useConfirm(); -const config = useConfigStore(); +const config = useYtpConfig(); const fieldTypes = ['string', 'text', 'bool'] as const; const fieldTypeItems = [...fieldTypes]; diff --git a/ui/app/components/NewDownload.vue b/ui/app/components/NewDownload.vue index c93933f6..8af6845c 100644 --- a/ui/app/components/NewDownload.vue +++ b/ui/app/components/NewDownload.vue @@ -520,7 +520,7 @@ const emitter = defineEmits<{ (e: 'getInfo', url: string, preset: string | undefined, cli: string | undefined): void; (e: 'clear_form'): void; }>(); -const config = useConfigStore(); +const config = useYtpConfig(); const toast = useNotification(); const dialog = useDialog(); const { findPreset, hasPreset, selectItems, getPresetDefault } = usePresetOptions(); diff --git a/ui/app/components/NotifyDropdown.vue b/ui/app/components/NotifyDropdown.vue index 872625e3..b9da56d8 100644 --- a/ui/app/components/NotifyDropdown.vue +++ b/ui/app/components/NotifyDropdown.vue @@ -138,9 +138,10 @@