Returns empty array for no ids (#5684)

This commit is contained in:
Shaz Amjad 2021-09-21 23:50:36 +10:00 committed by GitHub
parent c753be5bfe
commit 58d1454425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -989,6 +989,9 @@ export function makeGetChannelsForIds(): (state: GlobalState, ids: string[]) =>
getAllChannels,
(state: GlobalState, ids: string[]) => ids,
(allChannels, ids) => {
if (!ids) {
return [];
}
return ids.map((id) => allChannels[id]);
},
);