commit 793599652b98b4b8ec04ba132be434498554e97c parent 2668f412bca64787cd7a92cc6826a759cfef918d Author: Marc Stibane <marc@taler.net> Date: Thu, 27 Aug 2026 09:15:07 +0200 formatting Diffstat:
| M | TalerWallet1/Views/Main/MainView.swift | | | 69 | ++++++++++++++++++++++++++++++++++----------------------------------- |
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/TalerWallet1/Views/Main/MainView.swift b/TalerWallet1/Views/Main/MainView.swift @@ -182,45 +182,44 @@ struct MainView: View { // Color.clear } } - } - .overlay { - if locked { - Color.gray.opacity(0.75) - .animation(.easeInOut, value: biometricService.isAuthenticated) - if let errorMessage = biometricService.authenticationError { - Text(errorMessage) - .talerFont(.title) - .foregroundColor(.red) - .multilineTextAlignment(.center) - .padding() - .background(WalletColors().backgroundColor) - .onTapGesture { + }.overlay { + if locked { + Color.gray.opacity(0.75) + .animation(.easeInOut, value: biometricService.isAuthenticated) + if let errorMessage = biometricService.authenticationError { + Text(errorMessage) + .talerFont(.title) + .foregroundColor(.red) + .multilineTextAlignment(.center) + .padding() + .background(WalletColors().backgroundColor) + .onTapGesture { + biometricService.authenticationError = nil + biometricService.authenticateUser() + } + .onAppear { + DispatchQueue.main.asyncAfter(deadline: .now() + 3) { biometricService.authenticationError = nil - biometricService.authenticateUser() - } - .onAppear { - DispatchQueue.main.asyncAfter(deadline: .now() + 3) { - biometricService.authenticationError = nil - if !biometricService.canAuthenticate { - let _ = print("authentication not available") - useAuthentication = false // switch off - } + if !biometricService.canAuthenticate { + let _ = print("authentication not available") + useAuthentication = false // switch off } } - } else { - Image(TALER_LOGO) - .resizable() - .scaledToFit() - .frame(width: 100, height: 100) - .onAppear { - biometricService.authenticateUser() - } - .onTapGesture { - biometricService.authenticateUser() - } - } + } + } else { + Image(TALER_LOGO) + .resizable() + .scaledToFit() + .frame(width: 100, height: 100) + .onAppear { + biometricService.authenticateUser() + } + .onTapGesture { + biometricService.authenticateUser() + } } - } // biometrics + } + } // biometrics let mainGroup = Group { // show launch animation until either ready or error