mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-10 05:06:18 +00:00
fix: Prevent FOUC and repetitive setting of about info
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body style="background-color: var(--background-one)">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -23,7 +23,6 @@ html {
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: var(--background-one);
|
||||
}
|
||||
|
||||
html,
|
||||
|
||||
@@ -16,8 +16,6 @@ export function api_base_url(): string {
|
||||
if (browser) {
|
||||
const apiUrl = localStorage.getItem(URL_KEY) || default_api_url;
|
||||
|
||||
set_about_info(apiUrl);
|
||||
|
||||
return apiUrl;
|
||||
}
|
||||
|
||||
@@ -46,11 +44,11 @@ export function set_api_base_url(url?: string) {
|
||||
localStorage.removeItem(URL_KEY);
|
||||
} else {
|
||||
localStorage.setItem(URL_KEY, url);
|
||||
set_about_info(url);
|
||||
}
|
||||
set_about_info(api_base_url());
|
||||
}
|
||||
|
||||
function set_about_info(apiUrl: string) {
|
||||
export function set_about_info(apiUrl: string) {
|
||||
if (!localStorage.getItem(STATUS_KEY) || !localStorage.getItem(EMAIL_KEY)) {
|
||||
fetch(`${apiUrl}/v4/about`)
|
||||
.then((response) => (response.ok ? response.json() : null))
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
|
||||
<style lang="scss">
|
||||
footer {
|
||||
background-color: var(--background-one);
|
||||
max-width: min(87%, 100rem);
|
||||
padding: 5rem 0rem;
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
import { events as themeEvents } from '$util/themeEvents';
|
||||
|
||||
import FooterHost from '$layout/Footer/FooterHost.svelte';
|
||||
import { api_base_url, set_about_info } from '$data/api/settings';
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
@@ -50,6 +51,7 @@
|
||||
);
|
||||
|
||||
onMount(() => {
|
||||
set_about_info(api_base_url());
|
||||
new DateTriggerEventHandler(themeEvents);
|
||||
|
||||
isRestoring.set(true);
|
||||
|
||||
Reference in New Issue
Block a user