fix(ui): handle null chat in folder drop handler for cross-account drag (#25928)

This commit is contained in:
G30 2026-06-16 18:26:35 -04:00 • committed by GitHub
parent 232421f40b
commit e5ed45fb20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -176,24 +176,26 @@
});
}
// Move the chat
const res = await updateChatFolderIdById(
localStorage.token,
chat.id,
folderId
).catch((error) => {
toast.error(`${error}`);
return null;
});
if (chat) {
// Move the chat
const res = await updateChatFolderIdById(
localStorage.token,
chat.id,
folderId
).catch((error) => {
toast.error(`${error}`);
return null;
});
onItemMove({
originFolderId: chat.folder_id,
targetFolderId: folderId,
e
});
onItemMove({
originFolderId: chat.folder_id,
targetFolderId: folderId,
e
});
if (res) {
dispatch('update');
if (res) {
dispatch('update');
}
}
}
} catch (error) {