mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-03-28 04:25:28 +00:00
Fix flow
This commit is contained in:
parent
3fbfecb171
commit
afa3f4dd9c
1 changed files with 4 additions and 4 deletions
|
@ -48,11 +48,12 @@ struct AccountDetailHeaderView: View {
|
||||||
}
|
}
|
||||||
.onChange(of: watcher.latestEvent?.id) {
|
.onChange(of: watcher.latestEvent?.id) {
|
||||||
if let latestEvent = watcher.latestEvent, let latestEvent = latestEvent as? StreamEventNotification {
|
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 {
|
Task {
|
||||||
if viewModel.account?.isLinkedToPremiumAccount == true {
|
if viewModel.account?.isLinkedToPremiumAccount == true {
|
||||||
await viewModel.fetchAccount()
|
await viewModel.fetchAccount()
|
||||||
} else {
|
} else{
|
||||||
try? await viewModel.followButtonViewModel?.refreshRelationship()
|
try? await viewModel.followButtonViewModel?.refreshRelationship()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,9 +334,8 @@ struct AccountDetailHeaderView: View {
|
||||||
Task {
|
Task {
|
||||||
if viewModel.account?.isLinkedToPremiumAccount == true {
|
if viewModel.account?.isLinkedToPremiumAccount == true {
|
||||||
try? await viewModel.followPremiumAccount()
|
try? await viewModel.followPremiumAccount()
|
||||||
} else {
|
|
||||||
try? await viewModel.followButtonViewModel?.follow()
|
|
||||||
}
|
}
|
||||||
|
try? await viewModel.followButtonViewModel?.follow()
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Text("$ Subscribe")
|
Text("$ Subscribe")
|
||||||
|
|
Loading…
Reference in a new issue