Skip to content

Commit

Permalink
Fix post refresh crash (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored Jan 5, 2025
1 parent e7af56a commit 91bb72e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mlem/App/Views/Shared/ExpandedPost/CommentPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct CommentPage: View {
}
}
.refreshable {
_ = await Task {
_ = await Task { @MainActor in
await tracker?.refresh()
}.value
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class CommentTreeTracker: Hashable {
loadingState = .idle
}

@MainActor
func refresh() async {
errorDetails = nil
loadingState = .idle
Expand Down
2 changes: 1 addition & 1 deletion Mlem/App/Views/Shared/ExpandedPost/PostPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct PostPage: View {
}
}
.refreshable {
_ = await Task {
_ = await Task { @MainActor in
do {
try await post.refresh(upgradeOperation: nil)
await tracker?.refresh()
Expand Down

0 comments on commit 91bb72e

Please sign in to comment.