Update welshman session stuff

This commit is contained in:
Jon Staab
2025-04-11 11:51:15 -07:00
parent 84af4d2d8e
commit 10a1e6e640
9 changed files with 51 additions and 93 deletions
+3 -4
View File
@@ -1,22 +1,21 @@
<script lang="ts">
import type {Profile} from "@welshman/util"
import {PROFILE, createProfile, createEvent} from "@welshman/util"
import {addSession, publishThunk} from "@welshman/app"
import {loginWithNip01, publishThunk} from "@welshman/app"
import Button from "@lib/components/Button.svelte"
import ProfileEditForm from "@app/components/ProfileEditForm.svelte"
import {INDEXER_RELAYS} from "@app/state"
type Props = {
secret: string
pubkey: string
}
const {secret, pubkey}: Props = $props()
const {secret}: Props = $props()
const onsubmit = (profile: Profile) => {
const event = createEvent(PROFILE, createProfile(profile))
addSession({method: "nip01", secret, pubkey})
loginWithNip01(secret)
publishThunk({event, relays: INDEXER_RELAYS})
}
</script>