Skip to content

Commit

Permalink
Merge pull request #636 from squidowl/fix/dont-jump-backlog-missing-r…
Browse files Browse the repository at this point in the history
…eadmarker

Don't jump to backlog when readmarker missing
  • Loading branch information
tarkah authored Oct 28, 2024
2 parents d9c3659 + d45572c commit 02a8be9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions data/src/history/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ impl Manager {
.unwrap_or_default()
}

pub fn read_marker(&self, kind: &history::Kind) -> Option<history::ReadMarker> {
self.data
.map
.get(kind)
.map(|history| history.read_marker())
.unwrap_or_default()
}

pub fn broadcast(
&mut self,
server: &Server,
Expand Down
4 changes: 4 additions & 0 deletions src/buffer/scroll_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ impl State {
return self.scroll_to_message(message, kind, history, config);
}

if history.read_marker(&kind.into()).is_none() {
return Task::none();
}

let Some(history::View {
total,
old_messages,
Expand Down

0 comments on commit 02a8be9

Please sign in to comment.