This commit is contained in:
Timothy Jaeryang Baek 2025-07-31 16:27:20 +04:00
parent d3547f0f54
commit 1c83f48c45

View file

@ -114,6 +114,8 @@
} else { } else {
// Handle the drag-and-drop data for folders or chats (same as before) // Handle the drag-and-drop data for folders or chats (same as before)
const dataTransfer = e.dataTransfer.getData('text/plain'); const dataTransfer = e.dataTransfer.getData('text/plain');
try {
const data = JSON.parse(dataTransfer); const data = JSON.parse(dataTransfer);
console.log(data); console.log(data);
@ -157,17 +159,22 @@
} }
// Move the chat // Move the chat
const res = await updateChatFolderIdById(localStorage.token, chat.id, folderId).catch( const res = await updateChatFolderIdById(
(error) => { localStorage.token,
chat.id,
folderId
).catch((error) => {
toast.error(`${error}`); toast.error(`${error}`);
return null; return null;
} });
);
if (res) { if (res) {
dispatch('update'); dispatch('update');
} }
} }
} catch (error) {
console.log('Error parsing dataTransfer:', error);
}
} }
} }
} }