mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/server-info: reload the page if turnstile sitekey changes
This commit is contained in:
parent
f8a6b533be
commit
416a9efdd1
1 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import { browser } from "$app/environment";
|
||||||
|
|
||||||
import { get, writable } from "svelte/store";
|
import { get, writable } from "svelte/store";
|
||||||
import { currentApiURL } from "$lib/api/api-url";
|
import { currentApiURL } from "$lib/api/api-url";
|
||||||
|
|
||||||
|
@ -50,6 +52,17 @@ export const getServerInfo = async () => {
|
||||||
info: freshInfo,
|
info: freshInfo,
|
||||||
origin: currentApiURL(),
|
origin: currentApiURL(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
reload the page if turnstile sitekey changed.
|
||||||
|
there's no other proper way to do this, at least i couldn't find any :(
|
||||||
|
*/
|
||||||
|
if (cache?.info?.cobalt?.turnstileSitekey && freshInfo?.cobalt?.turnstileSitekey) {
|
||||||
|
if (browser) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue