refac
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user