This commit is contained in:
Ryan Chen
2025-10-29 22:17:45 -04:00
parent 5ebdd60ea0
commit 7f1d4fbdda

View File

@@ -22,8 +22,14 @@ export const ConversationList = ({
useEffect(() => { useEffect(() => {
const loadConversations = async () => { const loadConversations = async () => {
try { try {
const fetchedConversations = let fetchedConversations =
await conversationService.getAllConversations(); await conversationService.getAllConversations();
if (conversations.length == 0) {
await conversationService.createConversation();
fetchedConversations =
await conversationService.getAllConversations();
}
setConversations( setConversations(
fetchedConversations.map((conversation) => ({ fetchedConversations.map((conversation) => ({
id: conversation.id, id: conversation.id,