From 437a1ff7f9b72f924988f5f2f99cedc0a853245e Mon Sep 17 00:00:00 2001
From: Manuel Kocher <manuel.kocher@tugraz.at>
Date: Mon, 19 Dec 2022 15:43:35 +0100
Subject: [PATCH] bugfix for loading spinner: page should display spinner all
 the time when loading

---
 packages/app-shell/src/app-shell.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js
index 4af68486..a286b252 100644
--- a/packages/app-shell/src/app-shell.js
+++ b/packages/app-shell/src/app-shell.js
@@ -940,12 +940,16 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
         const slotClassMap = classMap({hidden: !appHidden});
 
         if (!appHidden) {
+            // if app is loaded correctly, remove spinner
             this.updateComplete.then(() => {
-                // XXX: Safari 11 doesn't like CSS being applied to slots or via HTML,
-                // so we have to remove the slot instead of hiding it
-                // select slots with no name attribute
                 const slot = this.shadowRoot.querySelector('slot:not([name])');
-                if (slot) slot.remove();
+                if (slot) slot.style.display = 'none';
+            });
+        } else {
+            // if app is not loaded correctly, show spinner
+            this.updateComplete.then(() => {
+                const slot = this.shadowRoot.querySelector('slot:not([name])');
+                if (slot) slot.style.display = '';
             });
         }
 
-- 
GitLab