File tree Expand file tree Collapse file tree
Bitkit/Views/Wallets/Receive Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,11 +114,15 @@ struct ReceiveQr: View {
114114 . padding ( . horizontal, 16 )
115115 }
116116 . onAppear {
117- // Default to the unified ("Auto") tab the first time a Lightning invoice is available.
118- // Guarded so it does not override the tab the user picked ( e.g. after returning from Edit) .
119- if !hasAppliedDefaultTab && tab == nil && !wallet . bolt11 . isEmpty {
120- selectedTab = . unified
117+ // Apply the default-tab choice at most once, on the first appearance. The flag is set
118+ // unconditionally here (even before bolt11 is ready) so a later reappearance — e.g.
119+ // returning from Edit once the invoice has loaded — can never override the tab the user picked.
120+ if !hasAppliedDefaultTab {
121121 hasAppliedDefaultTab = true
122+ // Default to the unified ("Auto") tab when a Lightning invoice is already available.
123+ if tab == nil && !wallet. bolt11. isEmpty {
124+ selectedTab = . unified
125+ }
122126 }
123127 }
124128 }
You can’t perform that action at this time.
0 commit comments