Fix conversation hydration — clear stale state before fresh fetch on mount
This commit is contained in:
@@ -59,6 +59,8 @@ export default function Home() {
|
|||||||
document.documentElement.setAttribute('data-theme', s.theme || 'light');
|
document.documentElement.setAttribute('data-theme', s.theme || 'light');
|
||||||
document.documentElement.setAttribute('data-font', s.font_size || 'medium');
|
document.documentElement.setAttribute('data-font', s.font_size || 'medium');
|
||||||
}).catch(console.error);
|
}).catch(console.error);
|
||||||
|
// Clear stale persisted conversations then fetch fresh
|
||||||
|
setConversations([]);
|
||||||
api.getConversations().then(setConversations).catch(console.error);
|
api.getConversations().then(setConversations).catch(console.error);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user