diff --git a/src/components/Nav/SearchModal/SearchModal.tsx b/src/components/Nav/SearchModal/SearchModal.tsx index 71f0f367..6498fb92 100644 --- a/src/components/Nav/SearchModal/SearchModal.tsx +++ b/src/components/Nav/SearchModal/SearchModal.tsx @@ -57,7 +57,7 @@ export const SearchModal = () => { const [isLoading, setIsLoading] = createSignal(false) const [offset, setOffset] = createSignal(0) const [searchResultsList, { refetch: loadSearchResults, mutate: setSearchResultsList }] = createResource< - Shout[] + Shout[] | null >( async () => { setIsLoading(true) @@ -73,7 +73,7 @@ export const SearchModal = () => { }, { ssrLoadFrom: 'initial', - initialValue: [], + initialValue: null, }, ) @@ -86,7 +86,7 @@ export const SearchModal = () => { await debouncedLoadMore() } else { setIsLoading(false) - setSearchResultsList([]) + setSearchResultsList(null) } } @@ -96,14 +96,14 @@ export const SearchModal = () => { await debouncedLoadMore() } else { setIsLoading(false) - setSearchResultsList([]) + setSearchResultsList(null) } } // Cleanup the debounce timer when the component unmounts onCleanup(() => { debouncedLoadMore.cancel() - console.log('cleanup search') + // console.debug('[SearchModal] cleanup debouncing search') }) return ( @@ -156,7 +156,7 @@ export const SearchModal = () => { - +