mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 04:39:58 +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 { currentApiURL } from "$lib/api/api-url";
|
||||
|
||||
|
@ -50,6 +52,17 @@ export const getServerInfo = async () => {
|
|||
info: freshInfo,
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue