mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-15 21:04:46 +01:00
fix (boot): cleanup boot section
This commit is contained in:
parent
45b8fd99e5
commit
2888cc5f99
1 changed files with 0 additions and 4 deletions
|
|
@ -42,7 +42,6 @@ async function setup_xdg_open() {
|
||||||
async function setup_device() {
|
async function setup_device() {
|
||||||
const className = "ontouchstart" in window ? "touch-yes" : "touch-no";
|
const className = "ontouchstart" in window ? "touch-yes" : "touch-no";
|
||||||
document.body.classList.add(className);
|
document.body.classList.add(className);
|
||||||
|
|
||||||
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||||
document.body.classList.add("dark-mode");
|
document.body.classList.add("dark-mode");
|
||||||
}
|
}
|
||||||
|
|
@ -81,16 +80,13 @@ async function setup_polyfill() {
|
||||||
|
|
||||||
async function verify_origin(config) {
|
async function verify_origin(config) {
|
||||||
const origin = config["origin"];
|
const origin = config["origin"];
|
||||||
|
|
||||||
// happy path
|
// happy path
|
||||||
if (!origin) return;
|
if (!origin) return;
|
||||||
else if (location.origin === origin) return;
|
else if (location.origin === origin) return;
|
||||||
|
|
||||||
// non happy path
|
// non happy path
|
||||||
const u = new URL(origin);
|
const u = new URL(origin);
|
||||||
if (u.host === location.host) return;
|
if (u.host === location.host) return;
|
||||||
else if (u.hostname === location.hostname) return;
|
else if (u.hostname === location.hostname) return;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
location.href = origin + location.pathname + location.search;
|
location.href = origin + location.pathname + location.search;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue