linkylinky-dashboard/src/routes/__layout.svelte

33 lines
838 B
Svelte
Raw Normal View History

2021-08-16 14:04:23 +00:00
<script>
import '../app.postcss';
import Sidebar from '$lib/Sidebar.svelte';
import UserStore from '$lib/UserStore';
2021-08-21 06:34:54 +00:00
import { onMount } from 'svelte';
import * as localForage from 'localforage';
2021-08-21 06:40:32 +00:00
/**
* Master init for all things userstore, b/c async stuff somethimes does weired shit.
* Yes i know this isn't the best way to implement this, but linkylinky dashboard is just a oneshot sideproject r/n.
*/
2021-08-21 06:34:54 +00:00
onMount(() => {
UserStore.init();
localForage.getItem('userdata', (err, value) => {
if (value) {
if (value.token) {
UserStore.login(value);
}
}
});
});
2021-08-16 14:04:23 +00:00
</script>
<div style="min-height: 640px;" class="bg-white dark:bg-gray-800">
<div class="h-screen flex overflow-hidden">
<Sidebar />
<div class="px-4 py-8 flex flex-col w-0 flex-1 overflow-y-scroll">
2021-08-16 14:04:23 +00:00
<slot />
</div>
</div>
</div>