stack/getpaid 2 61 la advanced settings - #229
Draft
BullishNode wants to merge 3 commits into
Draft
Conversation
Auto-sweep and hide-on-home were rendered by four separate copies of the same two switches: one inside the shared Advanced Settings sheet, and one private widget per product screen for the case where the online product is unavailable. Collapse them into a single card so the labels, the ordering and — next — the rule coupling the two switches exist in exactly one place.
Tapping Auto-sweep in Lightning Address advanced settings appeared to do nothing. The write did run — the failure was that it could not be seen: the sheet is handed to `showModalBottomSheet` as an already-built widget, so the modal route holds one snapshot of the wallet behavior for as long as it is open. The switch is driven by that snapshot's value, so it never moved, and the happy path logs nothing, which is why the log looked idle too. Carry the cubit into the modal and rebuild the sheet from state, so a toggle made inside the sheet is reflected inside that same sheet. The same snapshot wiring existed on the Donation Page and Point of Sale sheets and is fixed with it; the cross-product test now asserts the reflection, and fails without it.
Hide on home and auto-sweep were independent switches, so a wallet could be hidden from the home list while still accumulating every payment it received — its balance gone from the only list its owner counts. Couple them one way: auto-sweep gates hiding. Turning auto-sweep off unhides the wallet, hiding is refused while sweeping is off, and unhiding stays allowed whatever the state — including for a wallet left hidden by data written before this rule. The rule is one pure function applied at the write itself, in WalletRepository, so no screen (existing or future, Get Paid or BTCPay) can persist the forbidden pair; the same function resolves the optimistic UI update, and the shared behavior card disables hiding and says what it depends on.
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.
Stack created with GitHub Stacks CLI • Give Feedback 💬