diff --git a/frontend/src/stores.js b/frontend/src/stores.js index a9c9590..2f97edb 100644 --- a/frontend/src/stores.js +++ b/frontend/src/stores.js @@ -30,33 +30,28 @@ class ChannelsStore extends Store { gateway.subscribe(GatewayEventType.Ready, ({ channels }) => { this.value = channels; - this.updated(); }); gateway.subscribe(GatewayEventType.ChannelCreate, (channel) => { this.value.push(channel); - this.updated(); }); gateway.subscribe(GatewayEventType.ChannelDelete, ({ id }) => { const index = this.value.findIndex(e => e.id === id); - if (!index) + if (index === -1) return; this.value.splice(index, 1); - this.updated(); }); gateway.subscribe(GatewayEventType.ChannelUpdate, (data) => { const index = this.value.findIndex(e => e.id === data.id); - if (!index) + if (index === -1) return; - if (!this.value[index]) return; this.value[index] = data; - this.updated(); }); }