mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Only proceed with completion check if the id matches.
This commit is contained in:
committed by
jeffrey-signal
parent
6b7509d4f8
commit
81305bfc6b
@@ -105,6 +105,11 @@ class ViewReceivedGiftViewModel(
|
||||
private fun awaitRedemptionCompletion(setAsPrimary: Boolean): Completable {
|
||||
return Completable.create { emitter ->
|
||||
val messageObserver = MessageObserver { messageId ->
|
||||
if (messageId.id != this.messageId) {
|
||||
return@MessageObserver
|
||||
}
|
||||
|
||||
Log.d(TAG, "Received update for $messageId while awaiting completion of redemption.")
|
||||
val message = SignalDatabase.messages.getMessageRecord(messageId.id)
|
||||
when (message.requireGiftBadge().redemptionState) {
|
||||
GiftBadge.RedemptionState.REDEEMED -> emitter.onComplete()
|
||||
|
||||
Reference in New Issue
Block a user