only select new channels in selector if they aren't currently selected

This commit is contained in:
Sean Yesmunt 2020-03-20 15:16:47 -04:00
parent 9b5860c1bf
commit 6af22e7caf

View file

@ -46,7 +46,14 @@ function ChannelSelector(props: Props) {
<MenuList className="menu__list">
{channels &&
channels.map(channel => (
<MenuItem key={channel.canonical_url} onSelect={() => onChannelSelect(channel.canonical_url)}>
<MenuItem
key={channel.canonical_url}
onSelect={() => {
if (selectedChannelUrl !== channel.canonical_url) {
onChannelSelect(channel.canonical_url);
}
}}
>
<ChannelListItem uri={channel.canonical_url} />
</MenuItem>
))}