Skip to content

Commit

Permalink
Fix "couldnt_mark_post_as_read" when switching accounts (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored May 4, 2024
1 parent 2861f35 commit 0834c01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mlem/Models/Batchers/MarkReadBatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class MarkReadBatcher {
}
}

func clearStaged() {
staged.removeAll()
}

func dispatchSending() async {
guard sending.count > 0 else {
return
Expand Down
1 change: 1 addition & 0 deletions Mlem/Window.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ struct Window: View {
DispatchQueue.main.async {
Task {
await markReadBatcher.flush()
markReadBatcher.clearStaged()
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
Expand Down

0 comments on commit 0834c01

Please sign in to comment.