From 07e6133509857024c0dc4d48be96f5c5b709551d Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Tue, 10 Oct 2023 00:36:46 -0700 Subject: [PATCH] Put case statements in their own variable scope --- binderhub/static/js/index.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/binderhub/static/js/index.js b/binderhub/static/js/index.js index f118eca16..6e192dadb 100644 --- a/binderhub/static/js/index.js +++ b/binderhub/static/js/index.js @@ -62,17 +62,20 @@ async function build(providerSpec, log, fitAddon, path, pathType) { } switch (data.phase) { - case "waiting": + case "waiting": { $("#phase-waiting").removeClass("hidden"); break; - case "building": + } + case "building": { $("#phase-building").removeClass("hidden"); log.show(); break; - case "pushing": + } + case "pushing": { $("#phase-pushing").removeClass("hidden"); break; - case "failed": + } + case "failed": { $("#build-progress .progress-bar").addClass("hidden"); $("#phase-failed").removeClass("hidden"); @@ -89,12 +92,14 @@ async function build(providerSpec, log, fitAddon, path, pathType) { } image.close(); break; - case "built": + } + case "built": { $("#phase-already-built").removeClass("hidden"); $("#phase-launching").removeClass("hidden"); updateFavicon(BASE_URL + "favicon_success.ico"); break; - case "ready": + } + case "ready": { image.close(); // If data.url is an absolute URL, it'll be used. Else, it'll be interpreted // relative to current page's URL. @@ -107,10 +112,12 @@ async function build(providerSpec, log, fitAddon, path, pathType) { pathType, ); break; - default: + } + default: { console.log("Unknown phase in response from server"); console.log(data); break; + } } } return image;