From 79b79e0aec9b34c1ef9c122a079961e86ab1a62a Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Fri, 27 Nov 2020 14:47:11 +0100 Subject: [PATCH] Fix protocol status badge not updating for active service with id 0 --- frontend/ts/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/ts/index.ts b/frontend/ts/index.ts index 1c2d700..a339c33 100644 --- a/frontend/ts/index.ts +++ b/frontend/ts/index.ts @@ -772,7 +772,8 @@ function updateNavigation() { } function updateStatusButton() { - if (!selectedServiceId) return; + if (typeof selectedServiceId !== 'number') return; + const protocol = services[selectedServiceId]?.view?.getURL().split('://')[0] || 'unknown'; securityButton?.childNodes.forEach(el => { if (el instanceof HTMLElement) {