mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 04:15:35 +00:00
retaining original state
This commit is contained in:
1 parent
2366c2cd94
commit
a185b2a12a
1 file changed
+2
-2
@@ -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 }));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user