fix: null channels bug

This commit is contained in:
kangmingtay committed 2021-05-25 17:35:24 +08:00
1 parent 44cedc9411
commit c2d41e7045
1 file changed
+1 -1
+1 -1
View File
@@ -99,7 +99,7 @@ export const useStore = (props) => {
return {
// We can export computed values here to map the authors to each message
messages: messages.map((x) => ({ ...x, author: users.get(x.user_id) })),
channels: channels.sort((a, b) => a.slug.localeCompare(b.slug)),
channels: (channels !== null) ? channels.sort((a, b) => a.slug.localeCompare(b.slug)) : [],
users,
}
}