import { isLoading } from 'svelte-i18n';
import { _ } from 'svelte-i18n';
- import { forums } from '$/stores/forums';
+ import { getForums } from '$/stores/forums';
import ErrorBlock from '$/components/error_block/error_block.svelte';
import ForumList from '$/components/forum_list/forum_list.svelte';
import Header from '$/components/header/header.svelte';
import Loader from '$/components/loader/loader.svelte';
import Footer from '$/components/footer/footer.svelte';
+
+ $: store = getForums();
+ $: forums = $store.data;
</script>
{#if $isLoading}
<slot />
</main>
<nav title={$_('forum_list.title')}>
- {#if $forums.loading}
+ {#if $store.loading}
<Loader />
{/if}
- {#if $forums.error}
+ {#if $store.error}
<ErrorBlock message={$_('forum_list.error.unavailable')} />
{/if}
- {#if $forums.data}
- <ForumList forums={$forums.data} />
+ {#if forums}
+ <ForumList forums={forums} />
{/if}
</nav>
<Footer />