frontend: fallback to first channel if the selected channel cant be found
This commit is contained in:
parent
0a17ea2ac6
commit
d837dbddb4
1 changed files with 2 additions and 0 deletions
|
@ -49,6 +49,8 @@ class ChannelsStore extends Store {
|
||||||
const index = this.value.findIndex(e => e.id === selectedChannel.value.id);
|
const index = this.value.findIndex(e => e.id === selectedChannel.value.id);
|
||||||
if (index !== -1)
|
if (index !== -1)
|
||||||
selectedChannel.set(this.value[index]);
|
selectedChannel.set(this.value[index]);
|
||||||
|
else // if the channel doesn't exist, just select the first one
|
||||||
|
selectedChannel.set(channels[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.updated();
|
this.updated();
|
||||||
|
|
Loading…
Reference in a new issue