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

This commit is contained in:
G30
2026-06-17 00:26:35 +02:00
committed by GitHub
parent 232421f40b
commit e5ed45fb20
@@ -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) {