diff --git a/web/src/stores/connection.store.ts b/web/src/stores/connection.store.ts index bba278a..f06b3e8 100644 --- a/web/src/stores/connection.store.ts +++ b/web/src/stores/connection.store.ts @@ -64,7 +64,15 @@ useNuiEvent('addNetwork', (data: WifiNetwork) => { useNuiEvent('removeNetwork', (ssid: string) => { const connection = useConnection() + const oldConnections = connection.networks connection.networks = connection.networks.filter((network) => network.ssid !== ssid) + + // Check to see if the networks array was changed via the filter operation. + // If it was, let the network event bus be aware of this change. + if(oldConnections.length !== connection.networks.length) { + const networkBus = useEventBus('network') + networkBus.emit('updated') + } }) useNuiEvent('connect', (ssid: string) => {