fix(core): syncRemote crash

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk
2025-08-28 15:22:34 +02:00
parent d4c8a21504
commit fafb88d9ce

View File

@@ -337,10 +337,12 @@ class SnapEnhance {
}
private fun syncRemote() {
if (!appContext.isLoggedIn()) return
val myUserId = appContext.database.myUserId
val streakEntries = appContext.database.getFeedEntries(Int.MAX_VALUE, whereClause = "streak_count IS NOT NULL AND streak_count > 0").associate {
(it.friendUserId ?: it.participants?.firstOrNull { it != myUserId }) to it
}.filter { it.key != null }
val streakEntries = appContext.database.getFeedEntries(Int.MAX_VALUE, whereClause = "streak_count IS NOT NULL AND streak_count > 0")
.associateBy { entry -> (entry.friendUserId ?: entry.participants?.firstOrNull { it != myUserId }) }
.filter { it.key != null }
appContext.bridgeClient.sync(object : SyncCallback.Stub() {
override fun syncFriend(uuid: String): String? {