From 7da11f71fd03124e2be859a1a94fb2064e9758f2 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:29:42 +0400 Subject: [PATCH] comment --- .../kotlin/chat/simplex/common/views/badges/BadgesView.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesView.kt index 6f16ba537e..ef2ecae607 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesView.kt @@ -41,7 +41,10 @@ fun currentShownBadge(): BadgeState? { return if (badgeState != null && badgeState.shown) badgeState else null } -// runs in the screen on top, the only one composed, and closes every screen above the badges modal in one go +// The badges modal shows the purchase state itself, so screens pushed over it have to go once a purchase +// appears. Only the top one is composed, so this runs there, closing them in one effect because a close per +// recomposition restarts showInView's transition, and stopping on a depth because closeModal defers removal. +// TODO [badges] ModalManager has no close-above and records no parentage; with either, the depth goes away. @Composable fun CloseWhenSupportGivesWay(modalManager: ModalManager, unwindToDepth: Int) { val gaveWay = BadgeStore.purchaseState(chatModel.currentUser.value?.userId) != null || currentShownBadge() != null