mirror of
https://github.com/edufeed-org/educards.git
synced 2025-12-10 00:34:34 +00:00
init ndk in layout component
This commit is contained in:
parent
c26760eb6d
commit
a8dcc4be11
4 changed files with 95 additions and 23 deletions
|
|
@ -2,6 +2,20 @@
|
|||
import '../app.css';
|
||||
import Navbar from '$lib/components/Navbar.svelte';
|
||||
let { children } = $props();
|
||||
|
||||
import { onMount } from 'svelte';
|
||||
import { ndkStore, initNDK } from '$lib/db';
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
await ndkStore.init();
|
||||
// You could auto-sign in here if you have stored credentials
|
||||
// or let the user explicitly sign in from a component
|
||||
initNDK();
|
||||
} catch (error) {
|
||||
console.error('Failed to initialize NDK:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Navbar />
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@
|
|||
function openModal() {
|
||||
addBoardModal.showModal();
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await getBoards();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="flex w-full">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue