From d837dbddb45a653777428915bddc6b5e62079392 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Fri, 6 May 2022 02:56:22 +0300 Subject: [PATCH] frontend: fallback to first channel if the selected channel cant be found --- frontend/src/stores.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/stores.js b/frontend/src/stores.js index 9cba74d..ab61c6a 100644 --- a/frontend/src/stores.js +++ b/frontend/src/stores.js @@ -49,6 +49,8 @@ class ChannelsStore extends Store { const index = this.value.findIndex(e => e.id === selectedChannel.value.id); if (index !== -1) selectedChannel.set(this.value[index]); + else // if the channel doesn't exist, just select the first one + selectedChannel.set(channels[0]); } } this.updated();