From 2b85c66f2ae1dabd85bb4c26595932648bc33698 Mon Sep 17 00:00:00 2001 From: Krystle Salazar Date: Wed, 9 Feb 2022 18:11:53 -0400 Subject: [PATCH] Unstuck `searchStatus` of search bar (#833) --- src/components/VHeader/VHeader.vue | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/VHeader/VHeader.vue b/src/components/VHeader/VHeader.vue index 3411ae7d90..ed169c2ad6 100644 --- a/src/components/VHeader/VHeader.vue +++ b/src/components/VHeader/VHeader.vue @@ -59,7 +59,6 @@ import { useContext, useRouter, watch, - watchEffect, } from '@nuxtjs/composition-api' import { MEDIA, SEARCH } from '~/constants/store-modules' @@ -147,9 +146,8 @@ const VHeader = defineComponent({ /** * Status is hidden below the medium breakpoint. * It shows Loading... or Number of results on bigger screens. - * @returns {string} */ - const setStatus = () => { + const searchStatus = computed(() => { if ( !isMinScreenMd.value || !isSearchRoute.value || @@ -158,11 +156,7 @@ const VHeader = defineComponent({ return '' if (isFetching.value) return i18n.t('header.loading') return getI18nCount(resultsCount.value) - } - - const searchStatus = ref(setStatus()) - - watchEffect(() => setStatus()) + }) const localSearchTerm = ref(store.state.search.query.q) const searchTerm = computed({