fix: drop Concord invite screen from back stack after forwarding to the community

ConcordInviteScreen auto-redeems and forwards to Route.ConcordServer, but it did
so with nav.newStack(). Since the community route isn't in the back stack yet,
newStack's popUpTo(target) matches nothing and the invite screen stays underneath.
Pressing Back from the community then reveals the invite screen, whose plain
remember(link) state resets to Working, re-runs joinConcordViaInvite, and forwards
right back — trapping the user in a Back→forward loop.

Forward with popUpTo(ConcordServer, ConcordInvite::class) instead, matching the
sibling group-creation screens (CreateGroupScreen, RelayGroupMetadataScreen), so
the invite screen is removed and Back returns to wherever the invite was opened.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeJJCDLdvi4KQEuozcMMBh
This commit is contained in:
Claude
2026-07-17 19:47:17 +00:00
parent 2ac9cc81f7
commit e3e85994f2
@@ -95,7 +95,10 @@ fun ConcordInviteScreen(
LaunchedEffect(state) {
(state as? RedeemState.Done)?.let { done ->
nav.newStack(Route.ConcordServer(done.communityId))
// Replace this invite screen with the community, dropping it from the back stack. If it
// stayed, Back from the community would land on the auto-redeeming spinner, which would
// immediately re-join and forward here again — trapping the user in a Back→forward loop.
nav.popUpTo(Route.ConcordServer(done.communityId), Route.ConcordInvite::class)
}
}