From dccb5ec58266927f86089875f2996b9f41e4adea Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 17 Jan 2023 12:36:34 -0800 Subject: [PATCH] fix unknown status check order Signed-off-by: Arthur Lu --- scripts/elements.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/elements.js b/scripts/elements.js index 702f540..e53ad7e 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -28,6 +28,9 @@ class Instance extends HTMLElement { } set data (data) { + if (data.status === "unknown") { + data.status = "stopped"; + } let typeImg = this.shadowElement.querySelector("#instance-type"); typeImg.src = `images/instances/${data.type}/${data.status}.svg`; typeImg.alt = `${data.status} instance`; @@ -47,9 +50,6 @@ class Instance extends HTMLElement { } let nodeImg = this.shadowElement.querySelector("#node-status"); - if (data.status === "unknown") { - data.status = "stopped"; - } nodeImg.src = `images/nodes/${data.node.status}.svg`; let nodeParagraph = this.shadowElement.querySelector("#node-name");