mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 03:18:23 +00:00
Two related races caused the "nothing to approve yet" flash / reopen:
1. IntentUtils.clear() in onDestroy was wiping intents added by a
concurrently-created new SignerActivity instance. Fix: track intent
IDs added by each MainViewModel instance (addedIntentIds) and remove
only those in onDestroy, leaving any intents owned by the new
instance untouched.
2. LaunchedEffect(intent) in AccountScreen received a new IntentWrapper
reference on every recomposition (created inline), so it re-ran
after onRemoveIntentData emptied _intents, re-adding the just-
accepted intent before finishAndRemoveTask() could close the
activity. Fix: wrap with remember(intent) { IntentWrapper(intent) }
so the effect only re-runs when the actual Intent reference changes
(i.e. a genuine new intent from onNewIntent).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>