refac
This commit is contained in:
1 parent
4ad7a9bb9c
commit
a5c359aede
1 file changed
+5
-4
@@ -61,7 +61,9 @@
|
||||
}
|
||||
|
||||
const importChatsHandler = async (_chats) => {
|
||||
const chats = _chats.map((chat) => {
|
||||
const res = await importChats(
|
||||
localStorage.token,
|
||||
_chats.map((chat) => {
|
||||
if (chat.chat) {
|
||||
return {
|
||||
chat: chat.chat,
|
||||
@@ -82,9 +84,8 @@
|
||||
updated_at: chat?.updated_at ?? null
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const res = await importChats(localStorage.token, chats);
|
||||
})
|
||||
);
|
||||
if (res) {
|
||||
toast.success(`Successfully imported ${res.length} chats.`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user