Merge remote-tracking branch 'origin/main' into issues/1226

This commit is contained in:
shatanikmahanty
2024-10-06 12:26:05 +05:30
18 changed files with 219 additions and 75 deletions

View File

@@ -119,6 +119,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
.delete(id, {})
.then(() => {
fetchConversations();
resetConversation();
})
.catch((error) => console.error(error));
};
@@ -155,6 +156,15 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
});
};
const resetConversation = () => {
dispatch(setConversation([]));
dispatch(
updateConversationId({
query: { conversationId: null },
}),
);
};
async function updateConversationName(updatedConversation: {
name: string;
id: string;
@@ -240,12 +250,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
if (isMobile) {
setNavOpen(!navOpen);
}
dispatch(setConversation([]));
dispatch(
updateConversationId({
query: { conversationId: null },
}),
);
resetConversation();
}}
className={({ isActive }) =>
`${isActive ? 'bg-gray-3000 dark:bg-transparent' : ''
@@ -321,6 +326,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
if (isMobile) {
setNavOpen(!navOpen);
}
resetConversation();
}}
to="/settings"
className={({ isActive }) =>
@@ -344,6 +350,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
if (isMobile) {
setNavOpen(!navOpen);
}
resetConversation();
}}
to="/about"
className={({ isActive }) =>