From b914144ae51b4df93117d4b741bd724dc7890896 Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 19 Jul 2021 15:15:58 +0500 Subject: [PATCH] GridBuffer: skip empty inbox --- src/components/Player/GridBuffer.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Player/GridBuffer.jsx b/src/components/Player/GridBuffer.jsx index bdcb711..d9b8644 100644 --- a/src/components/Player/GridBuffer.jsx +++ b/src/components/Player/GridBuffer.jsx @@ -8,9 +8,11 @@ export default function ({ inbox, currentWindow }) { const [messages, setMessages] = useState([]) useEffect(() => { - const currentInbox = + const currentInboxObj = inbox.find(({ id }) => - id === currentWindow.id).lines + id === currentWindow.id) + + const currentInbox = currentInboxObj?.lines ?? [] const newOrPrev = (cur, prev) => i => { const byId = (list, i) =>