Skip to content

Keep account form values when adding an account fails #267

Description

@tsouth89

Problem

The directory-account form is reset even when addDirectoryAccount rejects. A user who enters a label and directory, hits an error, and wants to retry must re-enter both values.

Where

apps/desktop-tauri/src/surfaces/settings/providers/AccountsPanel.tsx

The helper catches the rejection, but the submit path calls resetForm() unconditionally afterward.

Expected behavior

  • Clear the form only after a successful account creation.
  • Preserve the entered label and directory on failure.
  • Keep the existing error message visible so the user can correct and retry.

Tests

Add a rejected-promise regression test that verifies both fields are preserved, plus a success case that verifies they are cleared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersjavascriptPull requests that update javascript code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions