Skip to content

Commit 8087e55

Browse files
feat: fix imports (#378)
* add * add * add * add * add * Update login_form.svelte * add * add * add * add * Update login_form.svelte * add * add * ad * add * Update config.ts * add * add * Update +page.svelte * feat: final fix
1 parent 032ad76 commit 8087e55

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

  • src/frontend/src/routes/(needs_onboarding)/(navbar_and_footer)

src/frontend/src/routes/(needs_onboarding)/(navbar_and_footer)/+layout.svelte

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,40 @@
9494
}
9595
]);
9696
97-
$effect.pre(() => {
98-
const donationPlatforms = [
99-
{ key: 'PUBLIC_BUY_ME_A_COFFEE', name: 'Buy Me A Coffee', path: 'SiBuymeacoffee' },
100-
{ key: 'PUBLIC_LIBERAPAY', name: 'Liberapay', path: 'SiLiberapay' },
101-
{ key: 'PUBLIC_KO_FI', name: 'Ko-Fi', path: 'SiKofi' },
102-
{ key: 'PUBLIC_PATREON', name: 'Patreon', path: 'SiPatreon' }
103-
];
97+
const donationPlatforms = [
98+
{
99+
key: 'PUBLIC_BUY_ME_A_COFFEE',
100+
name: 'Buy Me A Coffee',
101+
iconModule: await import('@icons-pack/svelte-simple-icons/icons/SiBuymeacoffee')
102+
},
103+
{
104+
key: 'PUBLIC_LIBERAPAY',
105+
name: 'Liberapay',
106+
iconModule: await import('@icons-pack/svelte-simple-icons/icons/SiLiberapay')
107+
},
108+
{
109+
key: 'PUBLIC_KO_FI',
110+
name: 'Ko-Fi',
111+
iconModule: await import('@icons-pack/svelte-simple-icons/icons/SiKofi')
112+
},
113+
{
114+
key: 'PUBLIC_PATREON',
115+
name: 'Patreon',
116+
iconModule: await import('@icons-pack/svelte-simple-icons/icons/SiPatreon')
117+
}
118+
];
104119
105-
donationPlatforms.forEach(async ({ key, name, path }) => {
120+
$effect.pre(() => {
121+
donationPlatforms.forEach(({ key, name, iconModule }) => {
106122
const href = (env as Record<string, string | undefined>)[key];
107123
124+
// Check if the environment variable exists and isn't already in the list
108125
if (href && !footerLinks.some((link) => link.href === href)) {
109-
const module = await import(
110-
`@icons-pack/svelte-simple-icons/icons/${path}.svelte` /* @vite-ignore */
111-
);
112-
113126
footerLinks.push({
114127
href,
115128
name,
116-
icon: module.default,
129+
// Use the .default property from the awaited import
130+
icon: iconModule.default,
117131
order: footerLinks.length + 1
118132
});
119133
}

0 commit comments

Comments
 (0)