fix: expired state

This commit is contained in:
Zack Spear
2023-06-26 15:47:21 -07:00
committed by Zack Spear
parent 32fd82dea4
commit 41225e8c4e
3 changed files with 19 additions and 18 deletions

View File

@@ -9,28 +9,28 @@ import type { UserProfileLink } from '~/types/userProfile';
const accountStore = useAccountStore();
const { stateData } = storeToRefs(useServerStore());
const links = ref<UserProfileLink[]>([
{
click: () => accountStore.troubleshoot(),
external: true,
icon: InformationCircleIcon,
text: 'Placeholder Button',
},
{
external: true,
href: CONNECT_FORUMS,
icon: InformationCircleIcon,
text: 'Connect Support Forum',
},
// {
// click: () => accountStore.troubleshoot(),
// external: true,
// icon: InformationCircleIcon,
// text: 'Placeholder Button',
// },
// {
// external: true,
// href: CONNECT_FORUMS,
// icon: InformationCircleIcon,
// text: 'Connect Support Forum',
// },
]);
</script>
<template>
<ul v-if="stateData.error" class="list-reset flex flex-col gap-y-4px -mx-8px mb-4px py-12px px-16px bg-unraid-red/60 rounded">
<ul v-if="stateData.error" class="font-semibold list-reset flex flex-col gap-y-4px -mx-8px mb-4px py-12px px-16px text-white bg-unraid-red/90 rounded">
<h3 class="text-18px">{{ stateData.heading }}</h3>
<p class="text-14px opacity-85">{{ stateData.message }}</p>
<p class="text-14px">{{ stateData.message }}</p>
<template v-if="links">
<li v-for="(link, index) in links" :key="`link_${index}`" class="-mx-8px">
<UpcDropdownItem :item="link" />
<UpcDropdownItem :item="link" class="text-white" />
</li>
</template>
</ul>

View File

@@ -16,13 +16,13 @@ const uptimeOrExpiredTime = computed(() => {
const parsedTime = ref<string>('');
const formattedTime = computed<string>(() => {
return dateFormat((uptimeOrExpiredTime.value).toString());
return dateFormat(uptimeOrExpiredTime.value);
});
const countUp = computed<boolean>(() => state.value !== 'TRIAL' && state.value !== 'ENOCONN');
const output = computed(() => {
if (!countUp.value) {
if (!countUp.value || state.value === 'EEXPIRED') {
return {
title: state.value === 'EEXPIRED'
? `Trial Key Expired at ${formattedTime.value}`

View File

@@ -214,6 +214,7 @@ export const useServerStore = defineStore('server', () => {
return {
actions: [
...(!registered.value ? [signInAction] : []),
...([purchaseAction, redeemAction]),
...(trialExtensionEligible.value ? [trialExtendAction] : []),
...(registered.value ? [signOutAction] : []),
],
@@ -287,7 +288,7 @@ export const useServerStore = defineStore('server', () => {
return {
actions: [
...(!registered.value ? [signInAction] : []),
...(registered.value ? [purchaseAction, redeemAction] : []),
...([purchaseAction, redeemAction]),
...(registered.value ? [signOutAction] : []),
],
error: true,