From a185b2a12a526e843b0a0723c02d255c02dc953c Mon Sep 17 00:00:00 2001 From: JeevaRamanathan M Date: Sat, 19 Oct 2024 04:45:00 +0000 Subject: [PATCH] retaining original state --- frontend/src/Navigation.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index c8252e37..d858bc02 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -96,14 +96,14 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }, [conversations?.data, dispatch]); async function fetchConversations() { - dispatch(setConversations({ data: null, loading: true })); + dispatch(setConversations({ ...conversations, loading: true })); return await getConversations() .then((fetchedConversations) => { dispatch(setConversations(fetchedConversations)); }) .catch((error) => { console.error('Failed to fetch conversations: ', error); - dispatch(setConversations({ data: null, loading: false })); + dispatch(setConversations({ ...conversations, loading: false })); }); }