Fix incorrect secret being downloaded

This commit is contained in:
Jon Staab
2026-01-13 14:28:21 -08:00
parent adb2ce4846
commit 23ffb15a8d
3 changed files with 7 additions and 8 deletions
+2 -4
View File
@@ -2,7 +2,6 @@
import {nsecEncode} from "nostr-tools/nip19"
import {encrypt} from "nostr-tools/nip49"
import {hexToBytes} from "@welshman/lib"
import {makeSecret} from "@welshman/util"
import {preventDefault, downloadText} from "@lib/html"
import Key from "@assets/icons/key-minimalistic.svg?dataurl"
import ArrowDown from "@assets/icons/arrow-down.svg?dataurl"
@@ -17,13 +16,12 @@
import {PLATFORM_NAME} from "@app/core/state"
type Props = {
secret: string
next: () => unknown
submitText?: string
}
const {next, submitText = "Continue"}: Props = $props()
const secret = makeSecret()
const {secret, next, submitText = "Continue"}: Props = $props()
const back = () => history.back()
+3 -3
View File
@@ -9,9 +9,9 @@
profile: Profile
}
const props: Props = $props()
const {secret, profile}: Props = $props()
const next = () => pushModal(SignUpComplete, props)
const next = () => pushModal(SignUpComplete, {secret, profile})
</script>
<KeyDownload {next} />
<KeyDownload {secret} {next} />
+2 -1
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import type {Profile} from "@welshman/util"
import {makeProfile} from "@welshman/util"
import {makeProfile, makeSecret} from "@welshman/util"
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
import AltArrowRight from "@assets/icons/alt-arrow-right.svg?dataurl"
import Icon from "@lib/components/Icon.svelte"
@@ -18,6 +18,7 @@
const {flow}: Props = $props()
const initialValues = {
secret: makeSecret(),
profile: makeProfile(),
shouldBroadcast: false,
}