Skip to content

Commit

Permalink
Move to the end of the chat when opening
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Dec 18, 2024
1 parent 604b3f5 commit a9a4f50
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/jupyter-chat/src/components/chat-messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,8 @@ export function Navigation(props: NavigationProps): JSX.Element {

unreadChanged(model, model.unreadMessages);

// Move to the first unread message or to last the message after messages has been
// first rendered.
if (model.unreadMessages.length) {
gotoMessage(Math.min(...model.unreadMessages));
} else {
gotoMessage(model.messages.length - 1, false);
}
// Move to the last the message after all the messages have been first rendered.
gotoMessage(model.messages.length - 1, false);

return () => {
model.unreadChanged?.disconnect(unreadChanged);
Expand Down

0 comments on commit a9a4f50

Please sign in to comment.