From 58f9eec8b1a43dd8dc05b1afcd193debdfee093a Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Wed, 31 Jan 2024 10:51:16 -0800 Subject: [PATCH] refactor: targeting keyType strings for Starter / Unleashed --- web/components/Registration.ce.vue | 2 +- web/components/UserProfile/CallbackFeedback.vue | 12 +++++++++++- web/store/server.ts | 12 +++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/web/components/Registration.ce.vue b/web/components/Registration.ce.vue index 4bf458422..ad0b042b3 100644 --- a/web/components/Registration.ce.vue +++ b/web/components/Registration.ce.vue @@ -92,7 +92,7 @@ const devicesAvailable = computed((): number => { }); const showTrialExpiration = computed((): boolean => state.value === 'TRIAL' || state.value === 'EEXPIRED'); -const showUpdateEligibility = computed((): boolean => !!(regExp.value && (state.value === 'STARTER' || state.value === 'UNLEASHED'))); +const showUpdateEligibility = computed((): boolean => !!(regExp.value)); const keyInstalled = computed((): boolean => !!(!stateDataError.value && state.value !== 'ENOKEYFILE')); const showTransferStatus = computed((): boolean => !!(keyInstalled.value && guid.value && !showTrialExpiration.value)); // filter out renew action and only display other key actions…renew is displayed in RegistrationUpdateExpirationAction diff --git a/web/components/UserProfile/CallbackFeedback.vue b/web/components/UserProfile/CallbackFeedback.vue index 60dc56269..04dc62362 100644 --- a/web/components/UserProfile/CallbackFeedback.vue +++ b/web/components/UserProfile/CallbackFeedback.vue @@ -199,6 +199,16 @@ const accountActionStatusCopy = computed((): { text: string; } => { }); const { copy, copied, isSupported } = useClipboard({ source: keyUrl.value }); + +/** + * Ideally we'd show this based off of regExp.value, but we will not have that value yet. + * So we'll use the keyType.value that we get from the keyInstall store. + */ +const showUpdateEligibility = computed(() => { + // rather than specifically targeting 'Starter' and 'Unleashed' we'll target all keys that are not 'Basic', 'Plus', 'Pro', 'Lifetime', or 'Trial' + if (!keyType.value) { return false; } + return !['Basic', 'Plus', 'Pro', 'Lifetime', 'Trial'].includes(keyType.value); +});