mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 03:15:06 +03:00
Fix SQL Editor search not showing snippets in folders (#38308)
This commit is contained in:
1 parent
8bf1fd5d10
commit
42802af6ed
1 file changed
+6
-1
@@ -53,7 +53,11 @@ export const SearchList = ({ search }: SearchListProps) => {
|
||||
)
|
||||
const totalNumber = (count as unknown as { count: number })?.count ?? 0
|
||||
|
||||
const snippets = useMemo(() => data?.pages.flatMap((page) => page.content), [data?.pages])
|
||||
const snippets = useMemo(
|
||||
// [Joshen] Set folder_id to null to ensure flat list
|
||||
() => data?.pages.flatMap((page) => page.content.map((x) => ({ ...x, folder_id: null }))),
|
||||
[data?.pages]
|
||||
)
|
||||
const treeState = formatFolderResponseForTreeView({ folders: [], contents: snippets as any })
|
||||
|
||||
const snippetsLastItemIds = useMemo(() => getLastItemIds(treeState), [treeState])
|
||||
@@ -117,6 +121,7 @@ export const SearchList = ({ search }: SearchListProps) => {
|
||||
</span>
|
||||
),
|
||||
}}
|
||||
isBranch={false}
|
||||
isOpened={isOpened && !isPreview}
|
||||
isSelected={isActive}
|
||||
isPreview={isPreview}
|
||||
|
||||
Reference in new issue
Block a user