Skip to content

Commit

Permalink
fix: prevent mixed view crash with a hack
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Aug 22, 2024
1 parent 8ac10d9 commit 743fb66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (m Model) updateViewport(msg tea.Msg) (Model, tea.Cmd) {
m.viewport.SetContent(view)
}

if m.context.curr == "reader" && m.viewport.ScrollPercent() >= lib.UserConfig.Reader.ReadThreshold {
// HACK: if the previous was mixed we never marked the post as read
if m.context.curr == "reader" && m.context.prev == "mixed" && m.viewport.ScrollPercent() >= lib.UserConfig.Reader.ReadThreshold {
lib.MarkRead(m.context.feeds, m.context.feed.ID, m.context.post.ID)
}

Expand Down

0 comments on commit 743fb66

Please sign in to comment.