@@ -8,6 +8,7 @@ struct MoneyStack: View {
88 var showEyeIcon : Bool = false
99 var enableSwipeGesture : Bool = false
1010
11+ @EnvironmentObject var app : AppViewModel
1112 @EnvironmentObject var currency : CurrencyViewModel
1213 @EnvironmentObject var settings : SettingsViewModel
1314
@@ -109,10 +110,29 @@ struct MoneyStack: View {
109110 . accessibilityIdentifier ( " TotalBalance " )
110111 . contentShape ( Rectangle ( ) )
111112 . onTapGesture {
113+ let previousDisplay = currency. primaryDisplay
114+
112115 withAnimation ( springAnimation) {
113116 currency. togglePrimaryDisplay ( )
114117 }
115118 Haptics . play ( . medium)
119+
120+ // Show toast on first switch
121+ if !settings. ignoresSwitchUnitToast {
122+ let newDisplay = currency. primaryDisplay
123+ let toUnitText = getUnitText ( for: newDisplay)
124+ let fromUnitText = getUnitText ( for: previousDisplay)
125+
126+ app. toast (
127+ type: . info,
128+ title: t ( " wallet__balance_unit_switched_title " , variables: [ " unit " : toUnitText] ) ,
129+ description: t ( " wallet__balance_unit_switched_message " , variables: [ " unit " : fromUnitText] ) ,
130+ visibilityTime: 5.0 ,
131+ accessibilityIdentifier: " BalanceUnitSwitchedToast "
132+ )
133+
134+ settings. ignoresSwitchUnitToast = true
135+ }
116136 }
117137 . animation ( springAnimation, value: currency. primaryDisplay)
118138 . conditionalGesture ( enableSwipeGesture) {
@@ -123,10 +143,24 @@ struct MoneyStack: View {
123143
124144 // Only trigger if horizontal swipe is more significant than vertical
125145 if abs ( horizontalAmount) > abs ( verticalAmount) {
146+ let wasHidden = settings. hideBalance
126147 withAnimation ( springAnimation) {
127148 settings. hideBalance. toggle ( )
128149 }
129150 Haptics . play ( . medium)
151+
152+ // Show toast on first hide (when balance becomes hidden)
153+ if !wasHidden && settings. hideBalance && !settings. ignoresHideBalanceToast {
154+ app. toast (
155+ type: . info,
156+ title: t ( " wallet__balance_hidden_title " ) ,
157+ description: t ( " wallet__balance_hidden_message " ) ,
158+ visibilityTime: 5.0 ,
159+ accessibilityIdentifier: " BalanceHiddenToast "
160+ )
161+
162+ settings. ignoresHideBalanceToast = true
163+ }
130164 }
131165 }
132166 }
@@ -158,6 +192,15 @@ private extension MoneyStack {
158192 }
159193 Haptics . play ( . medium)
160194 }
195+
196+ func getUnitText( for display: PrimaryDisplay ) -> String {
197+ switch display {
198+ case . bitcoin:
199+ return t ( " settings__general__unit_bitcoin " )
200+ case . fiat:
201+ return currency. selectedCurrency
202+ }
203+ }
161204}
162205
163206// MARK: - Helper View Modifier
0 commit comments