Skip to content

Commit

Permalink
fix: failed parsing problem (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
weboko authored Nov 17, 2023
1 parent 73ca3ab commit b753794
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions examples/store-reactjs-chat/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@ function App() {
}
)) {
const messages = await Promise.all(
messagesPromises
.map(async (p) => {
const msg = await p;
return decodeMessage(msg);
})
.filter(Boolean)
messagesPromises.map(async (p) => {
const msg = await p;
return decodeMessage(msg);
})
);

setMessages((currentMessages) => {
return currentMessages.concat(messages.reverse());
return currentMessages.concat(messages.filter(Boolean).reverse());
});
}
} catch (e) {
Expand Down

0 comments on commit b753794

Please sign in to comment.