Skip to content

Commit 368a169

Browse files
committed
move notification of address after ending db transaction
1 parent e08d249 commit 368a169

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/org/thoughtcrime/securesms/database/RecipientSettingsDatabase.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,20 @@ class RecipientSettingsDatabase @Inject constructor(
212212
arrayOf(address.toString())
213213
)
214214
if (rows > 0) {
215-
cache.remove(address)
216215
deleted += rows
217216
}
218217
}
219218
database.setTransactionSuccessful()
220219
} finally {
221220
database.endTransaction()
222221
}
222+
223+
// Notify after db transaction
224+
for (address in orphans) {
225+
cache.remove(address)
226+
mutableChangeNotification.tryEmit(address)
227+
}
228+
223229
return deleted
224230
}
225231

0 commit comments

Comments
 (0)