Add pull to refresh on post detail

This commit is contained in:
Thomas Ricouard 2023-12-10 08:42:26 +01:00
parent c11a31955c
commit d31af12bb6
1 changed files with 5 additions and 0 deletions

View File

@ -93,6 +93,11 @@ public struct StatusDetailView: View {
}
}
}
.refreshable {
Task {
await viewModel.fetch()
}
}
.onChange(of: watcher.latestEvent?.id) {
guard let lastEvent = watcher.latestEvent else { return }
viewModel.handleEvent(event: lastEvent, currentAccount: currentAccount.account)