GridBuffer: skip empty inbox

This commit is contained in:
He4eT 2021-07-19 15:15:58 +05:00 committed by Alexey
commit 30d8cfec1a

View file

@ -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) =>