From 8ae7cf05ccbb670c09e01ddb684d862a07598426 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Fri, 9 Jan 2026 09:55:10 -0800 Subject: [PATCH] Fix profile publishing on email sign up --- src/app/components/SignUpComplete.svelte | 14 ++------------ src/app/components/SignUpEmailConfirm.svelte | 4 +++- src/app/core/commands.ts | 12 ++++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/app/components/SignUpComplete.svelte b/src/app/components/SignUpComplete.svelte index 0a6d771a..d476cb0c 100644 --- a/src/app/components/SignUpComplete.svelte +++ b/src/app/components/SignUpComplete.svelte @@ -11,6 +11,7 @@ import ModalFooter from "@lib/components/ModalFooter.svelte" import {clearModals} from "@app/util/modal" import {PROTECTED} from "@app/core/state" + import {initProfile} from "@app/core/commands" type Props = { secret: string @@ -22,19 +23,8 @@ const back = () => history.back() const next = () => { - const template = createProfile(profile) - - // Start out protected by default - template.tags.push(PROTECTED) - - const event = makeEvent(PROFILE, template) - - // Log in first, then publish loginWithNip01(secret) - - // Don't publish anywhere yet, wait until they join a space - publishThunk({event, relays: []}) - + initProfile(profile) clearModals() } diff --git a/src/app/components/SignUpEmailConfirm.svelte b/src/app/components/SignUpEmailConfirm.svelte index 37228d8e..4f72860a 100644 --- a/src/app/components/SignUpEmailConfirm.svelte +++ b/src/app/components/SignUpEmailConfirm.svelte @@ -13,6 +13,7 @@ import Icon from "@lib/components/Icon.svelte" import ModalHeader from "@lib/components/ModalHeader.svelte" import ModalFooter from "@lib/components/ModalFooter.svelte" + import {initProfile} from "@app/core/commands" import {clearModals} from "@app/util/modal" import {setChecked} from "@app/util/notifications" import {pushToast} from "@app/util/toast" @@ -23,7 +24,7 @@ clientOptions: ClientOptions } - const {email, clientOptions}: Props = $props() + const {email, profile, clientOptions}: Props = $props() const back = () => history.back() @@ -36,6 +37,7 @@ try { loginWithPomade(clientOptions.group.group_pk.slice(2), clientOptions) pushToast({message: "Successfully logged in!"}) + initProfile(profile) setChecked("*") clearModals() } finally { diff --git a/src/app/core/commands.ts b/src/app/core/commands.ts index f2b04d51..13df184f 100644 --- a/src/app/core/commands.ts +++ b/src/app/core/commands.ts @@ -754,6 +754,18 @@ export const uploadFile = async (file: File, options: UploadFileOptions = {}) => // Update Profile +export const initProfile = (profile: Profile) => { + const template = createProfile(profile) + + // Start out protected by default + template.tags.push(PROTECTED) + + const event = makeEvent(PROFILE, template) + + // Don't publish anywhere yet, wait until they join a space + return publishThunk({event, relays: []}) +} + export const updateProfile = async ({ profile, shouldBroadcast = !getTag(PROTECTED, profile.event?.tags || []),