From dd46dcd67b8eb7c461e0fca32e882c7dbb2a3664 Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Fri, 4 Mar 2022 23:21:29 -0600
Subject: fix background images

---
 src/lib/BackgroundImage.svelte | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'src/lib/BackgroundImage.svelte')

diff --git a/src/lib/BackgroundImage.svelte b/src/lib/BackgroundImage.svelte
index 19144e2..94bbc3f 100644
--- a/src/lib/BackgroundImage.svelte
+++ b/src/lib/BackgroundImage.svelte
@@ -15,11 +15,8 @@
 		bodyStyle = ''
 		// hack since sometimes the style is not removed
 		if (browser) {
-			// if we don't wait a frame, svelte gives an error sometimes
-			requestAnimationFrame(() => {
-				let styleEl = document.getElementById('background-image-style')
-				if (styleEl) styleEl.remove()
-			})
+			let styleEl = document.getElementById('background-image-style')
+			if (styleEl) styleEl.innerHTML = ''
 		}
 	})
 </script>
-- 
cgit 

