Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
macwilko committed Dec 31, 2023
1 parent 34d63c2 commit 4394740
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/components/channel-feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ export default function ChannelFeed(props) {
} else {
const last = messages[messages.length - 1];

if (last.user.handle != channel.user.handle) {
if (last.user.handle !== channel.user.handle) {
setMessages([...messages, update], () => {
const feed = feedRef.current;
feed.scrollTop = feed.scrollHeight;
});
} else {
let mp = [...messages];
mp[messages.length - 1] = update;
setMessages(mp);
}
}
} else {
Expand Down

0 comments on commit 4394740

Please sign in to comment.