fix: Deleted friends/unfriends on the Friend Log will reappear when you close and open the app again (#1262)

This commit is contained in:
pa
2026-03-18 11:52:29 +09:00
parent 621f53e00f
commit 8d5e1fc7f9
3 changed files with 23 additions and 9 deletions
+21 -7
View File
@@ -116,13 +116,27 @@ const friendLogHistory = {
return friendLogHistory;
},
deleteFriendLogHistory(rowId) {
sqliteService.executeNonQuery(
`DELETE FROM ${dbVars.userPrefix}_friend_log_history WHERE id = @row_id`,
{
'@row_id': rowId
}
);
// https://github.com/vrcx-team/VRCX/issues/1262
deleteFriendLogHistory(entry) {
if (entry.rowId != null) {
sqliteService.executeNonQuery(
`DELETE FROM ${dbVars.userPrefix}_friend_log_history WHERE id = @row_id`,
{
'@row_id': entry.rowId
}
);
} else {
// Entries created in-session don't have a rowId yet;
// fall back to composite key so the DB row is still removed.
sqliteService.executeNonQuery(
`DELETE FROM ${dbVars.userPrefix}_friend_log_history WHERE created_at = @created_at AND type = @type AND user_id = @user_id`,
{
'@created_at': entry.created_at,
'@type': entry.type,
'@user_id': entry.userId
}
);
}
}
};