web/server-info: reload the page only if the sitekey actually changed

This commit is contained in:
wukko 2024-11-20 14:26:45 +06:00
parent 1833a95027
commit 9c8cb5611f
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -53,14 +53,9 @@ export const getServerInfo = async () => {
origin: currentApiURL(), origin: currentApiURL(),
}); });
/* // reload the page if turnstile sitekey changed
reload the page if turnstile sitekey changed. if (cache && cache?.info?.cobalt?.turnstileSitekey !== freshInfo?.cobalt?.turnstileSitekey) {
there's no other proper way to do this, at least i couldn't find any :( if (browser) window.location.reload();
*/
if (cache?.info?.cobalt?.turnstileSitekey && freshInfo?.cobalt?.turnstileSitekey) {
if (browser) {
window.location.reload();
}
} }
return true; return true;