From 10a573fb4d9124a84706913fb91b1c350ef09def Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Mon, 19 Jun 2023 17:45:02 -0500 Subject: [PATCH] refactor: callbacks and progress on actions --- .env.example | 3 +- _data/serverState.ts | 4 +- components/Modals.ce.vue | 8 +- components/UserProfile.ce.vue | 4 +- components/UserProfile/CallbackFeedback.vue | 50 ++-- components/UserProfile/DropdownContent.vue | 22 +- helpers/urls.ts | 2 +- nuxt.config.ts | 10 +- store/account.ts | 78 ++++--- store/callback.ts | 247 +++++++++++--------- store/callbackActions.ts | 68 ++++++ store/errors.ts | 2 +- store/installKey.ts | 12 +- store/purchase.ts | 14 +- store/server.ts | 1 + store/trial.ts | 14 +- types/callback.ts | 24 +- types/server.ts | 1 + 18 files changed, 349 insertions(+), 215 deletions(-) create mode 100644 store/callbackActions.ts diff --git a/.env.example b/.env.example index 0d4a753bf..86316d515 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ NUXT_PUBLIC_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams -NUXT_PUBLIC_UNRAID_NET=https://unraid.ddev.site \ No newline at end of file +NUXT_PUBLIC_UNRAID_NET=https://unraid.ddev.site +NUXT_PUBLIC_ACCOUNT=https://localhost:8008 diff --git a/_data/serverState.ts b/_data/serverState.ts index 8f38fa463..dee84c613 100644 --- a/_data/serverState.ts +++ b/_data/serverState.ts @@ -46,8 +46,8 @@ const serverState = { expireTime, lanIp: '192.168.0.1', locale: 'en', - pluginInstalled: false, - registered: false, + pluginInstalled: true, + registered: true, site: 'http://localhost:4321', state, uptime, diff --git a/components/Modals.ce.vue b/components/Modals.ce.vue index 92d9f495a..d7cc06c7f 100644 --- a/components/Modals.ce.vue +++ b/components/Modals.ce.vue @@ -3,13 +3,11 @@ import { storeToRefs } from 'pinia'; import 'tailwindcss/tailwind.css'; import '~/assets/main.css'; -import { useCallbackStore } from '~/store/callback'; +import { useCallbackActionsStore } from '~/store/callbackActions'; import { usePromoStore } from '~/store/promo'; -const callbackStore = useCallbackStore(); -const promoStore = usePromoStore(); -const { callbackFeedbackVisible } = storeToRefs(callbackStore); -const { promoVisible } = storeToRefs(promoStore); +const { callbackFeedbackVisible } = storeToRefs(useCallbackActionsStore()); +const { promoVisible } = storeToRefs(usePromoStore());