refactor: callback feedback

This commit is contained in:
Zack Spear
2023-06-07 18:26:23 -07:00
parent 1a239b6914
commit 8c7bf0e190
2 changed files with 19 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
import { storeToRefs } from 'pinia';
import 'tailwindcss/tailwind.css';
import '~/assets/main.css';
import { useAccountStore } from '~/store/account';
import { useCallbackStore } from '~/store/callback';
import { useInstallKeyStore } from '~/store/installKey';
@@ -13,8 +14,13 @@ withDefaults(defineProps<Props>(), {
open: false,
});
const accountStore = useAccountStore();
const callbackStore = useCallbackStore();
const installKeyStore = useInstallKeyStore();
const { updating, updateSuccess } = storeToRefs(accountStore);
const { callbackLoading, decryptedData } = storeToRefs(callbackStore);
const { installing, success } = storeToRefs(installKeyStore);
const close = () => {
if (callbackLoading.value) return console.debug('[close] not allowed');
@@ -37,6 +43,18 @@ const close = () => {
<BrandLoading v-if="callbackLoading" class="w-90px mx-auto" />
<pre class="text-left text-black p-8px w-full overflow-scroll bg-gray-400">{{ JSON.stringify(decryptedData, null, 2) }}</pre>
<p v-if="installing">Installing License Key</p>
<template v-if="(typeof success !== undefined)">
<p v-if="success">Installed License Key</p>
<p v-else>License Key Install Failed</p>
</template>
<p v-if="updating">Account Connect</p>
<template v-if="(typeof success !== undefined)">
<p v-if="success">Connect config updated with your account</p>
<p v-else>Connect config failed to update</p>
</template>
<div v-if="!callbackLoading" class="w-full max-w-xs flex flex-col gap-y-16px mx-auto">
<button
@click="close"

View File

@@ -77,9 +77,7 @@ export const useCallbackStore = defineStore('callback', () => {
// all actions have run
if (array.length === (index + 1)) {
console.debug('[actions] DONE');
setTimeout(() => {
callbackLoading.value = false;
}, 5000);
callbackLoading.value = false;
}
});
};