From b753794bdc36b931b5578a870b1eb1dbc2b44695 Mon Sep 17 00:00:00 2001 From: Sasha <118575614+weboko@users.noreply.github.com> Date: Fri, 17 Nov 2023 10:55:32 +0300 Subject: [PATCH] fix: failed parsing problem (#287) --- examples/store-reactjs-chat/src/App.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/store-reactjs-chat/src/App.js b/examples/store-reactjs-chat/src/App.js index f745ea2b..6b73d220 100644 --- a/examples/store-reactjs-chat/src/App.js +++ b/examples/store-reactjs-chat/src/App.js @@ -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) {