mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-03-28 04:25:28 +00:00
Refresh user profile on notification
This commit is contained in:
parent
8cb6eaa065
commit
24491decec
1 changed files with 8 additions and 6 deletions
|
@ -16,7 +16,7 @@ struct AccountDetailHeaderView: View {
|
||||||
@Environment(QuickLook.self) private var quickLook
|
@Environment(QuickLook.self) private var quickLook
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(TipedUsers.self) private var tipedUsers
|
@Environment(StreamWatcher.self) private var watcher
|
||||||
@Environment(\.redactionReasons) private var reasons
|
@Environment(\.redactionReasons) private var reasons
|
||||||
@Environment(\.isSupporter) private var isSupporter: Bool
|
@Environment(\.isSupporter) private var isSupporter: Bool
|
||||||
|
|
||||||
|
@ -46,13 +46,15 @@ struct AccountDetailHeaderView: View {
|
||||||
}
|
}
|
||||||
accountInfoView
|
accountInfoView
|
||||||
}
|
}
|
||||||
.onChange(of: tipedUsers.tipedUserCount, { _, _ in
|
.onChange(of: watcher.latestEvent?.id) {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
if let latestEvent = watcher.latestEvent, let latestEvent = latestEvent as? StreamEventNotification {
|
||||||
Task {
|
if latestEvent.notification.account.id == viewModel.accountId {
|
||||||
try? await viewModel.followButtonViewModel?.refreshRelationship()
|
Task {
|
||||||
|
try? await viewModel.followButtonViewModel?.refreshRelationship()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var headerImageView: some View {
|
private var headerImageView: some View {
|
||||||
|
|
Loading…
Reference in a new issue