Skip to content

best way to save what you love

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

wukko9c8cb5611f64
diff --git a/web/src/lib/api/server-info.ts b/web/src/lib/api/server-info.ts
index 8a3e1b60..0f36ceff 100644
--- a/web/src/lib/api/server-info.ts
+++ b/web/src/lib/api/server-info.ts
@@ -53,14 +53,9 @@ export const getServerInfo = async () => {
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();
- }
+ // reload the page if turnstile sitekey changed
+ if (cache && cache?.info?.cobalt?.turnstileSitekey !== freshInfo?.cobalt?.turnstileSitekey) {
+ if (browser) window.location.reload();
}
return true;