From 58b2802902ccc20f6b4a743a39355e6df357737f Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Sat, 21 Dec 2024 10:34:03 -0700 Subject: [PATCH] fix: set default sort to date_added_to_graph when no search params present --- src/stores/useDataStore/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stores/useDataStore/index.ts b/src/stores/useDataStore/index.ts index 2dfb79131..ffa0c3b21 100644 --- a/src/stores/useDataStore/index.ts +++ b/src/stores/useDataStore/index.ts @@ -186,6 +186,7 @@ export const useDataStore = create()( ...(filterNodeTypes.length > 0 ? { node_type: JSON.stringify(filterNodeTypes) } : {}), ...(word ? { word } : {}), ...(aiRefId && AISearchQuery ? { previous_search_ref_id: aiRefId } : {}), + ...(!word && !AISearchQuery ? { sort_by: 'date_added_to_graph' } : {}), } try {