asdf
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user