Skip to content

Commit 3ab11da

Browse files
committed
fix: set websiteUrl initial value to avoid compiler warns
1 parent 7c3e41a commit 3ab11da

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/lib/components/organisms/Footer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import FooterSection from '$components/molecules/FooterSection.svelte';
88
import Button from '$components/atoms/Button.svelte';
99
10-
type Props = { about?: BackendAbout; websiteUrl?: string | null };
10+
type Props = { about?: BackendAbout | null; websiteUrl?: string | null };
1111
let { about, websiteUrl }: Props = $props();
1212
</script>
1313

src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
const { data: about } = useSWR<BackendAbout>(`${RV_API_URL}/v4/about`);
1212
let referrer: string | null = $state(null);
13-
let websiteUrl: string | null = $state(null);
13+
let websiteUrl: string = $state('https://revanced.app');
1414
1515
$effect(() => {
1616
if ($about) websiteUrl = $about.socials[0].url;

svelte.config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ const config = {
1212
},
1313
env: {
1414
publicPrefix: 'RV'
15-
},
16-
prerender: {
17-
// in src/routes/+page.svelte and src/lib/components/organisms/Footer.svelte
18-
// websiteUrl is dynamically fetched from the API
19-
// when the site is built with adapter-static, the crawler tries to access
20-
// null/patches, null/download, etc... and so it'll fail
21-
// since it's not able to fetch external data
22-
handleHttpError: ({ status, message }) => {
23-
if (status === 404) return;
24-
throw new Error(message);
25-
}
2615
}
16+
// prerender: {
17+
// // in src/routes/+page.svelte and src/lib/components/organisms/Footer.svelte
18+
// // websiteUrl is dynamically fetched from the API
19+
// // when the site is built with adapter-static, the crawler tries to access
20+
// // null/patches, null/download, etc... and so it'll fail
21+
// // since it's not able to fetch external data
22+
// handleHttpError: ({ status, message }) => {
23+
// if (status === 404) return;
24+
// throw new Error(message);
25+
// }
26+
// }
2727
}
2828
};
2929

0 commit comments

Comments
 (0)