fix: display dropdown for pro key no connect installed (#848)

This commit is contained in:
Zack Spear
2024-02-14 08:10:28 -08:00
committed by GitHub
parent 8954700bcb
commit e6eb56466e
2 changed files with 7 additions and 11 deletions
+5 -11
View File
@@ -31,13 +31,9 @@ const {
guid, guid,
keyfile, keyfile,
lanIp, lanIp,
state,
connectPluginInstalled,
} = storeToRefs(serverStore); } = storeToRefs(serverStore);
const { bannerGradient, theme } = storeToRefs(useThemeStore()); const { bannerGradient, theme } = storeToRefs(useThemeStore());
const hideDropdown = computed(() => state.value === 'PRO' && !connectPluginInstalled.value);
/** /**
* Close dropdown when clicking outside * Close dropdown when clicking outside
* @note If in testing you have two variants of the component on a page the clickOutside will fire twice making it seem like it doesn't work * @note If in testing you have two variants of the component on a page the clickOutside will fire twice making it seem like it doesn't work
@@ -129,14 +125,12 @@ onBeforeMount(() => {
</span> </span>
</h1> </h1>
<template v-if="!hideDropdown"> <div class="block w-2px h-24px bg-gamma" />
<div class="block w-2px h-24px bg-gamma" />
<OnClickOutside class="flex items-center justify-end h-full" :options="{ ignore: [clickOutsideIgnoreTarget] }" @trigger="outsideDropdown"> <OnClickOutside class="flex items-center justify-end h-full" :options="{ ignore: [clickOutsideIgnoreTarget] }" @trigger="outsideDropdown">
<UpcDropdownTrigger ref="clickOutsideIgnoreTarget" :t="t" /> <UpcDropdownTrigger ref="clickOutsideIgnoreTarget" :t="t" />
<UpcDropdown ref="clickOutsideTarget" :t="t" /> <UpcDropdown ref="clickOutsideTarget" :t="t" />
</OnClickOutside> </OnClickOutside>
</template>
</div> </div>
</div> </div>
</template> </template>
@@ -35,6 +35,8 @@ const title = computed((): string => {
if (showErrorIcon.value) { return props.t('Learn more about the error'); } if (showErrorIcon.value) { return props.t('Learn more about the error'); }
return dropdownVisible.value ? props.t('Close Dropdown') : props.t('Open Dropdown'); return dropdownVisible.value ? props.t('Close Dropdown') : props.t('Open Dropdown');
}); });
// const hideAvatar = computed(() => state.value === 'PRO' && !connectPluginInstalled.value);
</script> </script>
<template> <template>