summaryrefslogtreecommitdiffstats
path: root/assets/js/themes.js
diff options
context:
space:
mode:
authorOmar Roth <omarroth@protonmail.com>2019-06-15 10:08:06 -0500
committerOmar Roth <omarroth@protonmail.com>2019-06-15 10:09:32 -0500
commit552f616305809d111f7540cbea93f89fad3d0760 (patch)
treed078614fb388923ab347c05491de4e34ae10d3f6 /assets/js/themes.js
parenta3164177f8e7e3d323006e08755230f850a5fdd9 (diff)
downloadinvidious-552f616305809d111f7540cbea93f89fad3d0760.tar.gz
invidious-552f616305809d111f7540cbea93f89fad3d0760.tar.bz2
invidious-552f616305809d111f7540cbea93f89fad3d0760.zip
Fix retry on timeout for AJAX requests
Diffstat (limited to 'assets/js/themes.js')
-rw-r--r--assets/js/themes.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/assets/js/themes.js b/assets/js/themes.js
index 178ff112..826c6597 100644
--- a/assets/js/themes.js
+++ b/assets/js/themes.js
@@ -9,10 +9,11 @@ toggle_theme.addEventListener('click', function () {
xhr.responseType = 'json';
xhr.timeout = 20000;
xhr.open('GET', url, true);
- xhr.send();
set_mode(dark_mode);
localStorage.setItem('dark_mode', dark_mode);
+
+ xhr.send();
});
window.addEventListener('storage', function (e) {