From 7c31d84f9450aca3b366a556db85bdd494fff2f9 Mon Sep 17 00:00:00 2001
From: David Luevano Alvarado <david@luevano.xyz>
Date: Fri, 5 Mar 2021 08:39:41 -0700
Subject: Add new video tutorial notes

---
 static/scripts/theme.js | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'static')

diff --git a/static/scripts/theme.js b/static/scripts/theme.js
index 2ffe621..4bfa68e 100644
--- a/static/scripts/theme.js
+++ b/static/scripts/theme.js
@@ -6,20 +6,23 @@ window.onload = () => {
 
   if(theme == null){
     local_storage.setItem('theme', 'dark');
-  }
-
-  if(theme == 'dark'){
     switch_theme.checked = true;
   }
   else{
-    switch_theme.checked = false;
+    if(theme == 'dark'){
+      switch_theme.checked = true;
+    }
+    else{
+      switch_theme.checked = false;
 
-    let theme = document.getElementById('theme-css');
-    let href = theme.getAttribute('href');
+      let theme = document.getElementById('theme-css');
+      let href = theme.getAttribute('href');
 
-    href = href.replace('dark.css', 'light.css');
-    theme.setAttribute('href', href);
+      href = href.replace('dark.css', 'light.css');
+      theme.setAttribute('href', href);
+    }
   }
+
 }
 
 function setTheme(){
-- 
cgit v1.2.3-70-g09d2