From 6b03742a351a1c759f48451742ba3003c79a4c67 Mon Sep 17 00:00:00 2001 From: Diogo Date: Thu, 22 Aug 2024 15:44:41 +0100 Subject: [PATCH] improve switching chat profile loader --- .../Shared/Views/NewChat/NewChatView.swift | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/ios/Shared/Views/NewChat/NewChatView.swift b/apps/ios/Shared/Views/NewChat/NewChatView.swift index 8abdf41286..de8fe90a15 100644 --- a/apps/ios/Shared/Views/NewChat/NewChatView.swift +++ b/apps/ios/Shared/Views/NewChat/NewChatView.swift @@ -463,15 +463,16 @@ private struct ActiveProfilePicker: View { @ViewBuilder private func viewBody() -> some View { NavigationView { - if switchingProfileByTimeout { - ProgressView("Switching profile…") - .frame(maxWidth: .infinity, maxHeight: .infinity) - .modifier(ThemedBackground(grouped: true)) - } else { - profilePicker() - .modifier(ThemedBackground(grouped: true)) - } - } + profilePicker() + .modifier(ThemedBackground(grouped: true)) + .overlay { + if switchingProfileByTimeout { + ProgressView() + .scaleEffect(2) + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + } + }.allowsHitTesting(!switchingProfileByTimeout) } @ViewBuilder private func profilePicker() -> some View { @@ -518,6 +519,7 @@ private struct ActiveProfilePicker: View { } } } + .opacity(switchingProfileByTimeout ? 0.4 : 1) } }