From afa3f4dd9cd1dcb7086a36633b7f52779cc29399 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Thu, 20 Jun 2024 19:25:28 +0200 Subject: [PATCH] Fix flow --- .../Account/Sources/Account/AccountDetailHeaderView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/Account/Sources/Account/AccountDetailHeaderView.swift b/Packages/Account/Sources/Account/AccountDetailHeaderView.swift index 602feff4..53e8e2ca 100644 --- a/Packages/Account/Sources/Account/AccountDetailHeaderView.swift +++ b/Packages/Account/Sources/Account/AccountDetailHeaderView.swift @@ -48,11 +48,12 @@ struct AccountDetailHeaderView: View { } .onChange(of: watcher.latestEvent?.id) { if let latestEvent = watcher.latestEvent, let latestEvent = latestEvent as? StreamEventNotification { - if latestEvent.notification.account.id == viewModel.accountId { + if latestEvent.notification.account.id == viewModel.accountId || + latestEvent.notification.account.id == viewModel.premiumAccount?.id { Task { if viewModel.account?.isLinkedToPremiumAccount == true { await viewModel.fetchAccount() - } else { + } else{ try? await viewModel.followButtonViewModel?.refreshRelationship() } } @@ -333,9 +334,8 @@ struct AccountDetailHeaderView: View { Task { if viewModel.account?.isLinkedToPremiumAccount == true { try? await viewModel.followPremiumAccount() - } else { - try? await viewModel.followButtonViewModel?.follow() } + try? await viewModel.followButtonViewModel?.follow() } } label: { Text("$ Subscribe")