GridBuffer: skip empty inbox

This commit is contained in:
He4eT 2021-07-19 15:15:58 +05:00
commit b914144ae5

View file

@ -8,9 +8,11 @@ export default function ({ inbox, currentWindow }) {
const [messages, setMessages] = useState([]) const [messages, setMessages] = useState([])
useEffect(() => { useEffect(() => {
const currentInbox = const currentInboxObj =
inbox.find(({ id }) => inbox.find(({ id }) =>
id === currentWindow.id).lines id === currentWindow.id)
const currentInbox = currentInboxObj?.lines ?? []
const newOrPrev = (cur, prev) => i => { const newOrPrev = (cur, prev) => i => {
const byId = (list, i) => const byId = (list, i) =>