fix: check update response modal expired key button styles

This commit is contained in:
Zack Spear
2024-01-30 16:33:28 -08:00
committed by Zack Spear
parent c5bc3454ff
commit 93d0c08955
2 changed files with 12 additions and 5 deletions
+2 -1
View File
@@ -34,6 +34,7 @@ const staticGuid = '1111-1111-5GDB-123412341234';
const uptime = Date.now() - 60 * 60 * 1000; // 1 hour ago
const twentyDaysAgo = Date.now() - 20 * 24 * 60 * 60 * 1000; // 20 days ago
const ninetyDaysAgo = Date.now() - 90 * 24 * 60 * 60 * 1000; // 90 days ago
const twoDaysAgo = Date.now() - 2 * 24 * 60 * 60 * 1000; // 2 days ago
// const oneDayAgo = Date.now() - 24 * 60 * 60 * 1000; // 1 day ago
const oneHourFromNow = Date.now() + 60 * 60 * 1000; // 1 hour from now
@@ -83,7 +84,7 @@ switch (state) {
regDev = 4;
// regExp = oneHourFromNow;
// regExp = oneDayFromNow;
regExp = twentyDaysAgo;
regExp = ninetyDaysAgo;
// regExp = uptime;
// regExp = 1696363920000; // nori.local's expiration
// @ts-ignore
@@ -110,12 +110,17 @@ const actionButtons = computed((): ButtonProps[] | null => {
return buttons;
}
// update available and stable branch - open changelog to commence update
// update available - open changelog to commence update
if (available.value) {
buttons.push({
btnStyle: availableWithRenewal.value
? 'outline'
: undefined,
click: async () => await updateOsChangelogStore.setReleaseForUpdate(updateOsResponse.value ?? null),
icon: EyeIcon,
text: availableWithRenewal.value ? props.t('View Changelog') : props.t('View Changelog to Start Update'),
text: availableWithRenewal.value
? props.t('View Changelog')
: props.t('View Changelog to Start Update'),
});
}
@@ -125,7 +130,7 @@ const actionButtons = computed((): ButtonProps[] | null => {
click: async () => await purchaseStore.renew(),
icon: KeyIcon,
iconRight: ArrowTopRightOnSquareIcon,
iconRightHoverDisplay: true,
iconRightHoverDisplay: false,
text: props.t('Extend Key'),
title: props.t('Pay your annual fee to continue receiving OS updates.'),
});
@@ -229,9 +234,10 @@ onBeforeMount(() => {
:text="t('Close')"
@click="close"
/>
<div v-if="actionButtons" class="flex flex-col xs:flex-row justify-end">
<div v-if="actionButtons" class="flex flex-col xs:flex-row justify-end gap-8px">
<BrandButton
v-for="item in actionButtons"
:btn-style="item.btnStyle ?? undefined"
:key="item.text"
:icon="item.icon"
:icon-right="item.iconRight"