diff --git a/apps/ios/Shared/Views/Badges/BadgesRedeemCodeView.swift b/apps/ios/Shared/Views/Badges/BadgesRedeemCodeView.swift index a46ce43afd..7a05b97ee4 100644 --- a/apps/ios/Shared/Views/Badges/BadgesRedeemCodeView.swift +++ b/apps/ios/Shared/Views/Badges/BadgesRedeemCodeView.swift @@ -327,9 +327,13 @@ struct BadgesRedeemLinkView: View { .padding(.bottom, 20) .frame(maxHeight: .infinity) .navigationBarTitleDisplayMode(.inline) + // the outcome closes what is on screen, which after a close here would be some other screen + .interactiveDismissDisabled(true) } private func redeemFromLink() { + // a second tap before the screen changes must not send the code again + guard step == .confirming else { return } guard let user = chatModel.currentUser else { return dismissAllSheets() } step = .issuing Task { diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesRedeemCodeView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesRedeemCodeView.kt index 24300d95ac..100c0b501f 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesRedeemCodeView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesRedeemCodeView.kt @@ -276,6 +276,8 @@ fun BadgesRedeemLinkView(rhId: Long?, code: String, close: () -> Unit) { val step = remember { mutableStateOf(BadgeLinkStep.Confirming) } fun redeemFromLink() { + // a second tap before the screen changes must not send the code again + if (step.value != BadgeLinkStep.Confirming) return val user = chatModel.currentUser.value ?: return close() step.value = BadgeLinkStep.Issuing withBGApi { @@ -295,7 +297,8 @@ fun BadgesRedeemLinkView(rhId: Long?, code: String, close: () -> Unit) { when (step.value) { BadgeLinkStep.Confirming -> ModalView(close) { Confirming(onConfirm = ::redeemFromLink, onCancel = close) } - BadgeLinkStep.Issuing -> ModalView(close) { BeingIssued() } + // the outcome closes what is on screen, which after a close here would be some other screen + BadgeLinkStep.Issuing -> ModalView(close, enableClose = false) { BeingIssued() } BadgeLinkStep.Redeemed -> BadgesView(ModalManager.end, close) } }