🐛 修复特定情况下分类改变错误

This commit is contained in:
目棃
2024-04-04 14:48:46 +08:00
parent e5ff294080
commit 54e941504d
2 changed files with 7 additions and 2 deletions

View File

@@ -346,7 +346,11 @@ async function updatePostsCollect(
if (postRes.length === 0) {
return false;
}
if (force) {
const unclassifiedSql = "SELECT * FROM UFMap where postId = ?";
const unclassifiedRes: TGApp.Sqlite.UserCollection.UFMap[] = await db.select(unclassifiedSql, [
postIds[i],
]);
if (force && unclassifiedRes.length > 0) {
const deleteCheck = await deletePostCollect(postIds[i]);
if (!deleteCheck) return false;
}