diff --git a/Packages/Account/Sources/Account/AccountDetailHeaderView.swift b/Packages/Account/Sources/Account/AccountDetailHeaderView.swift index 163783c2..be2315a2 100644 --- a/Packages/Account/Sources/Account/AccountDetailHeaderView.swift +++ b/Packages/Account/Sources/Account/AccountDetailHeaderView.swift @@ -30,42 +30,40 @@ struct AccountDetailHeaderView: View { } private var headerImageView: some View { - GeometryReader { _ in - ZStack(alignment: .bottomTrailing) { - if reasons.contains(.placeholder) { - Rectangle() - .foregroundColor(.gray) - .frame(height: bannerHeight) - } else { - LazyImage(url: account.header) { state in - if let image = state.image { - image - .resizingMode(.aspectFill) - .overlay(.black.opacity(0.50)) - } else if state.isLoading { - Color.gray - .frame(height: bannerHeight) - .shimmering() - } else { - Color.gray - .frame(height: bannerHeight) - } - } + ZStack(alignment: .bottomTrailing) { + if reasons.contains(.placeholder) { + Rectangle() + .foregroundColor(.gray) .frame(height: bannerHeight) + } else { + LazyImage(url: account.header) { state in + if let image = state.image { + image + .resizingMode(.aspectFill) + .overlay(.black.opacity(0.50)) + } else if state.isLoading { + Color.gray + .frame(height: bannerHeight) + .shimmering() + } else { + Color.gray + .frame(height: bannerHeight) + } } - - if viewModel.relationship?.followedBy == true { - Text("Follows You") - .font(.scaledFootnote) - .fontWeight(.semibold) - .padding(4) - .background(.ultraThinMaterial) - .cornerRadius(4) - .padding(8) - } + .frame(height: bannerHeight) + } + + if viewModel.relationship?.followedBy == true { + Text("Follows You") + .font(.scaledFootnote) + .fontWeight(.semibold) + .padding(4) + .background(.ultraThinMaterial) + .cornerRadius(4) + .padding(8) } - .background(Color.gray) } + .background(Color.gray) .frame(height: bannerHeight) .offset(y: scrollOffset > 0 ? -scrollOffset : 0) .contentShape(Rectangle()) diff --git a/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift b/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift index ed827bcd..46e07221 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift @@ -31,9 +31,11 @@ class NotificationsViewModel: ObservableObject { @Published var state: State = .loading @Published var selectedType: Models.Notification.NotificationType? { didSet { - notifications = [] - Task { - await fetchNotifications() + if oldValue != selectedType { + notifications = [] + Task { + await fetchNotifications() + } } } }