Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsrobot committed Dec 19, 2023
1 parent 434a65f commit 0c9f871
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions app/components/channel-feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,15 @@ export default function ChannelFeed(props) {
try {
const update = JSON.parse(newMessageJson.message);

if (update.user.handle == channel.user.handle) {
return;
}

if (messages.length > 0) {

const idx = messages.length - 1;
const last = messages[idx];

let i = 0;

while (i < messages.length) {
const msg = messages[i];

if (!!msg.optimistic && msg.user.handle == update.user.handle && msg.text == update.text) {
return;
}

i++;
}

if (last.id == update.id) {

let mp = [...messages];
Expand Down

0 comments on commit 0c9f871

Please sign in to comment.