From 4ee57ab935718a269fe7ab65b26ff27837d49003 Mon Sep 17 00:00:00 2001
From: Jakob Stendahl <jakobste@uio.no>
Date: Mon, 8 Nov 2021 06:55:13 +0100
Subject: :lipstick: If update started, keep showing update window while
 rebooting

---
 src_frontend/App.svelte | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src_frontend/App.svelte')

diff --git a/src_frontend/App.svelte b/src_frontend/App.svelte
index 3f68718..d9f5f92 100644
--- a/src_frontend/App.svelte
+++ b/src_frontend/App.svelte
@@ -8,7 +8,7 @@
 	import WidgetRoute from "./routes/WidgetRoute.svelte";
 	import UnknownRoute from "./routes/UnknownRoute.svelte";
 
-	import { connected, reconnecting } from "./stores/socketStore.js";
+	import { connected, reconnecting, openSocket } from "./stores/socketStore.js";
 
 	let main_router_routes = new Map();
 	main_router_routes.set(/^\/(schedules|modes|led_config|logs|settings|)(?:\/.*)?$/, wrap({
@@ -29,6 +29,11 @@
 	main_router_routes.set("*", wrap({
 		component: UnknownRoute
 	}));
+
+	let updateInProgess = false;
+	openSocket.on("updater", (state) => {
+		if (state == "start") { updateInProgess = true; }
+	});
 </script>
 
 <style>
@@ -99,7 +104,7 @@
 
 </style>
 
-{#if $connected}
+{#if $updateInProgess || $connected}
 <Router routes={main_router_routes} />
 {:else if $reconnecting}
 <div class="no-connection">
-- 
cgit v1.2.3

