Repository navigation
Conversation
A send, an amount Next or a Swap that finished after the phone rotated did nothing: the view model called back into the screen that had been destroyed, so the result went to a back stack nobody showed. Confirm kept loading, and Amount and Swap stayed put with the button enabled again. The view model now keeps the result as state (the sent hash, the confirm input, the swap error and the price impact warning) and the current screen acts on it, so the result reaches whichever screen is showing. Swap releases its loading state only after the screen has opened Confirm, as before.
…ter the screen is recreated Rotating the phone while a wallet was being imported or created left the user on onboarding, and a pick or a delete from the wallet list or the wallet details did nothing: the view model called back into the destroyed screen. The view model now keeps the outcome (imported, created, selected, or what Core reports after a delete) and the current screen acts on it.
…lletConnect finish after the screen is recreated The same stale callback hit every other screen whose view model called back after waiting on Core or the network: a saved price alert, an address added to a contact, an auto alert toast, a picked currency, an added token, an added node, a disconnected WalletConnect session and a failed WalletConnect pairing. Each view model now keeps that outcome as state for the current screen. Callbacks that run at once, or that reach a view model which outlives the screen (the WalletConnect request results and errors), are left as they are.
…eated is not lost Rotating the phone while the system asked for a fingerprint or the passcode lost the confirmation: the pending requests lived in the authenticator of the destroyed activity, so the prompt came back and a successful check did nothing. Turning on the app passcode, a send, a WalletConnect approval, deleting a wallet, an import or a new wallet then needed a second confirmation, and showing the Secret Phrase or enabling authentication during onboarding never moved on. The queue of pending requests now lives in MainViewModel, which outlives the activity. Where the confirmed action navigates (showing the Secret Phrase and enabling authentication in onboarding), rememberAuthorizedAction keeps the confirmation in a view model of that screen and the current screen acts on it.
Rotating the phone or switching the theme closed whatever sheet or dialog was open: Swap and fee details, network and validator pickers, the scanners, the WalletConnect wallet pickers, the info sheets, the delete wallet and delete node confirmations, and the rest. Their visibility now survives recreation with rememberSaveable; the delete confirmations keep the id of the wallet or node and find the row again.
… the first wallet After the first wallet was created or imported, a restore after Android closed the app in the background opened the root of the tab instead of the screen the user left. The back stack was saved under a key built from the start destination, which is onboarding in the process that created the wallet and the wallet root in the process that restores it, so the saved stack was never found. The start destination is read once per process, so the key reset nothing; it is gone, and the stack is found again.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rotating the phone or switching the theme while something was in progress lost it. Now:
The dismissed transfer error that came back was already fixed on main by e31e2bd.
Stacked on #1673; #1672 keeps the flows themselves open.
Fixes #1470