Skip to content

fix(desktop): show Continue when a raw nsec is loaded in the backup restore dialog - #6649

Open
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:fix/desktop-backup-restore-raw-nsec
Open

fix(desktop): show Continue when a raw nsec is loaded in the backup restore dialog#6649
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:fix/desktop-backup-restore-raw-nsec

Conversation

@BradGroux

Copy link
Copy Markdown
Contributor

Note: This is a replacement for PR #5308, which was accidentally closed when branches were force-pushed after a commit identity rewrite. The changes are identical, rebased onto the latest main.

Summary

The backup-file restore dialog accepts .key files containing a raw nsec1 private key. The file parser loads the key and displays "Nostr identity found" with the derived npub, but the submit button only rendered when mode === "key" or isPasswordStage (ncryptsec). A raw nsec in mode="backup" satisfies neither condition, so the user sees a recognized identity with no Continue button — a dead end with no forward action.

Add isValid to the submit button's render guard so a valid raw nsec shows the Continue button regardless of mode. The button's existing disabled={!isValid} check prevents submission of invalid input, and keyImportSubmitEnabled already validates the nsec by deriving its npub.

Related issue

Fixes #5261.

Testing

  • Desktop Biome, file-size, text-size, and pubkey-truncation checks passed.
  • TypeScript typecheck and production Vite build passed.
  • Full Tauri test suite passed: 2,270 tests, 0 failures, 14 ignored.
  • Desktop JS test suite passed.

…estore dialog

The backup-file restore dialog (mode="backup") accepts .key files
containing a raw nsec1 key. The file parser loads the key and shows
"Nostr identity found" with the derived npub, but the submit button
only rendered when mode === "key" or isPasswordStage (ncryptsec). A
raw nsec in backup mode satisfies neither condition, so the user sees
a recognized identity with no forward action — a dead end.

Add isValid to the render guard so a valid raw nsec shows the Continue
button regardless of mode. The button's disabled={!isValid} check
already prevents submission of invalid input.

Closes block#5261.

Co-authored-by: Brad Groux <brad@digitalmeld.com>
Signed-off-by: Brad Groux <brad@digitalmeld.com>
Signed-off-by: dm-builder <f01486f036641ccb52c11bb1e0ff2346ea89a8b4e3b49cd772249948f6fcbae6@digitalmeld.communities.buzz.xyz>
@BradGroux

Copy link
Copy Markdown
Contributor Author

This is a replacement for #5308, which was accidentally closed when branches were force-pushed after a commit identity rewrite. Prior review comments and feedback are preserved on the old PR:

#5308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: backup-file restore accepts raw .key/nsec but renders no Continue action

1 participant