From 26f303140a1b9e6dab1e2ed6eb50256e6b9369ba Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 28 Jan 2024 11:19:04 +0300 Subject: [PATCH] initial null fix --- src/components/Nav/SearchModal/SearchModal.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 = () => { - +