Skip to content

Commit c8cf712

Browse files
committed
move inline script to remove console warnings
1 parent 72a66d5 commit c8cf712

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

public/index.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@
77
<meta name="theme-color" content="#000000" />
88
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
99
<link rel="preconnect" href="https://hackertab.dev" />
10-
<script>
11-
// Blocking script to avoid the initial background flickering (switching from light to dark)
12-
// https://stackoverflow.com/a/63033934/3495717
13-
try {
14-
var theme = JSON.parse(localStorage.hackerTabPrefs).theme || 'dark'
15-
document.documentElement.classList.add(theme)
16-
} catch (e) { console.log(e) }
17-
</script>
10+
1811
<% if (!!+process.env.REACT_APP_WEB_BUILD) { %>
1912
<title>Hackertab</title>
2013
<link rel="manifest" href="%PUBLIC_URL%/web_manifest.json" />

public/startup.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Blocking script to avoid the initial background flickering (switching from light to dark)
2+
// https://stackoverflow.com/a/63033934/3495717
3+
try {
4+
var theme = JSON.parse(localStorage.hackerTabPrefs).theme || 'dark'
5+
document.documentElement.classList.add(theme)
6+
} catch (e) {
7+
console.log(e)
8+
}

0 commit comments

Comments
 (0)