mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
optional catchng is not supported by IE11
This commit is contained in:
parent
1e60b9a322
commit
026ea52445
2 changed files with 4 additions and 4 deletions
|
@ -466,7 +466,7 @@ function get_video_time() {
|
||||||
|
|
||||||
return timestamp || 0;
|
return timestamp || 0;
|
||||||
}
|
}
|
||||||
catch {
|
catch (e) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ toggle_theme.addEventListener('click', function () {
|
||||||
set_mode(dark_mode);
|
set_mode(dark_mode);
|
||||||
try {
|
try {
|
||||||
window.localStorage.setItem('dark_mode', dark_mode ? 'dark' : 'light');
|
window.localStorage.setItem('dark_mode', dark_mode ? 'dark' : 'light');
|
||||||
} catch {}
|
} catch (e) {}
|
||||||
|
|
||||||
xhr.send();
|
xhr.send();
|
||||||
});
|
});
|
||||||
|
@ -30,7 +30,7 @@ window.addEventListener('DOMContentLoaded', function () {
|
||||||
try {
|
try {
|
||||||
// Update localStorage if dark mode preference changed on preferences page
|
// Update localStorage if dark mode preference changed on preferences page
|
||||||
window.localStorage.setItem('dark_mode', dark_mode);
|
window.localStorage.setItem('dark_mode', dark_mode);
|
||||||
} catch {}
|
} catch (e) {}
|
||||||
update_mode(dark_mode);
|
update_mode(dark_mode);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ function scheme_switch (e) {
|
||||||
if (localStorage.getItem('dark_mode')) {
|
if (localStorage.getItem('dark_mode')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch (exception) {}
|
||||||
if (e.matches) {
|
if (e.matches) {
|
||||||
if (e.media.includes('dark')) {
|
if (e.media.includes('dark')) {
|
||||||
set_mode(true);
|
set_mode(true);
|
||||||
|
|
Loading…
Reference in a new issue