diff --git a/web/src/client/network/model.js b/web/src/client/network/model.js index 60d8cb480..c4f8ab9e7 100644 --- a/web/src/client/network/model.js +++ b/web/src/client/network/model.js @@ -42,7 +42,7 @@ const DeviceState = Object.freeze({ UNAVAILABLE: "unavailable", DISCONNECTED: "disconnected", CONFIG: "config", - NEEDAUTH: "auth", + NEEDAUTH: "needAuth", ACTIVATED: "activated", DEACTIVATING: "deactivating", FAILED: "failed" diff --git a/web/src/components/overview/NetworkSection.jsx b/web/src/components/overview/NetworkSection.jsx index 36129b912..6cb71e41d 100644 --- a/web/src/components/overview/NetworkSection.jsx +++ b/web/src/components/overview/NetworkSection.jsx @@ -37,10 +37,11 @@ export default function NetworkSection() { switch (type) { case NetworkEventTypes.DEVICE_ADDED: { setDevices((devs) => { - const newDevices = devs.filter((d) => d.name !== payload.name); - if (payload.connection) return newDevices; + const currentDevices = devs.filter((d) => d.name !== payload.name); + // only show connecting or connected devices + if (!payload.connection) return currentDevices; - return [...newDevices, client.fromApiDevice(payload)]; + return [...currentDevices, client.fromApiDevice(payload)]; }); break; } @@ -48,8 +49,10 @@ export default function NetworkSection() { case NetworkEventTypes.DEVICE_UPDATED: { const [name, data] = payload; setDevices(devs => { - const newDevices = devs.filter((d) => d.name !== name); - return [...newDevices, client.fromApiDevice(data)]; + const currentDevices = devs.filter((d) => d.name !== name); + // only show connecting or connected devices + if (!data.connection) return currentDevices; + return [...currentDevices, client.fromApiDevice(data)]; }); break; } @@ -95,8 +98,8 @@ export default function NetworkSection() { const summary = activeDevices.map(deviceSummary); const msg = sprintf( - // TRANSLATORS: header for the list of active network connections, - // %d is replaced by the number of active connections + // TRANSLATORS: header for the list of connected devices, + // %d is replaced by the number of active devices n_("%d device set:", "%d devices set:", total), total );