From 52bda60b052a692924c3c7331966b4f798011a99 Mon Sep 17 00:00:00 2001 From: Davide Date: Mon, 9 Dec 2024 00:53:46 +0100 Subject: [PATCH] Fix missing animations in profiles list (#986) The list was not animating e.g. on iCloud updates. Move .themeAnimation() from ProfileContainerView (ContainerModifier) to ProfileListView/ProfileGridView. --- Library/Sources/AppUIMain/Views/App/ProfileContainerView.swift | 2 -- Library/Sources/AppUIMain/Views/App/ProfileGridView.swift | 2 ++ Library/Sources/AppUIMain/Views/App/ProfileListView.swift | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Sources/AppUIMain/Views/App/ProfileContainerView.swift b/Library/Sources/AppUIMain/Views/App/ProfileContainerView.swift index c1d47609..b1bb57ac 100644 --- a/Library/Sources/AppUIMain/Views/App/ProfileContainerView.swift +++ b/Library/Sources/AppUIMain/Views/App/ProfileContainerView.swift @@ -108,8 +108,6 @@ private struct ContainerModifier: ViewModifier { .onChange(of: search) { profileManager.search(byName: $0) } - .themeAnimation(on: profileManager.isReady, category: .profiles) - .themeAnimation(on: profileManager.previews, category: .profiles) } private func emptyView() -> some View { diff --git a/Library/Sources/AppUIMain/Views/App/ProfileGridView.swift b/Library/Sources/AppUIMain/Views/App/ProfileGridView.swift index 72d23eb6..9ad5122f 100644 --- a/Library/Sources/AppUIMain/Views/App/ProfileGridView.swift +++ b/Library/Sources/AppUIMain/Views/App/ProfileGridView.swift @@ -73,6 +73,8 @@ struct ProfileGridView: View, Routable, TunnelInstallationProviding { } .padding(.horizontal) } + .themeAnimation(on: profileManager.isReady, category: .profiles) + .themeAnimation(on: profileManager.previews, category: .profiles) } .onReceive(tunnel.currentProfilePublisher) { currentProfile = $0 diff --git a/Library/Sources/AppUIMain/Views/App/ProfileListView.swift b/Library/Sources/AppUIMain/Views/App/ProfileListView.swift index 88346dbe..0a6c8a73 100644 --- a/Library/Sources/AppUIMain/Views/App/ProfileListView.swift +++ b/Library/Sources/AppUIMain/Views/App/ProfileListView.swift @@ -71,6 +71,8 @@ struct ProfileListView: View, Routable, TunnelInstallationProviding { .themeSection(header: Strings.Views.App.Folders.default) } .themeForm() + .themeAnimation(on: profileManager.isReady, category: .profiles) + .themeAnimation(on: profileManager.previews, category: .profiles) } } }