From c82a036b4320e35920d853b9d68fc1016cf6adfb Mon Sep 17 00:00:00 2001 From: serafettin Date: Mon, 15 Jul 2024 23:49:01 -0400 Subject: [PATCH] Iterate --- .../sections/IndexConversation/TabContainer/index.tsx | 2 ++ web-app/src/store/api/index.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web-app/src/components/sections/IndexConversation/TabContainer/index.tsx b/web-app/src/components/sections/IndexConversation/TabContainer/index.tsx index 247e6a0f..5ad790aa 100644 --- a/web-app/src/components/sections/IndexConversation/TabContainer/index.tsx +++ b/web-app/src/components/sections/IndexConversation/TabContainer/index.tsx @@ -39,6 +39,8 @@ export default function TabContainer() { if (!indexData.hasItems) { setTabKey(TabKey.Index); + } else { + setTabKey(TabKey.Chat); } }, [loading, indexData]); diff --git a/web-app/src/store/api/index.ts b/web-app/src/store/api/index.ts index 232fbb93..36d5c339 100644 --- a/web-app/src/store/api/index.ts +++ b/web-app/src/store/api/index.ts @@ -78,7 +78,7 @@ export const fetchIndex = createAsyncThunk( } try { - await dispatch(fetchIndexItems({ indexID: index.id, api })).unwrap(); + dispatch(fetchIndexItems({ indexID: index.id, api })).unwrap(); } catch (err) { console.error("Error fetching index items", err); }