Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/rotten-mugs-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(threading)

I think the form should be cleared upon successful submission. But definitely not cleared if there is an error. When I created my address it kept the form populated which felt odd

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added key to the new address form as the number of addresses we have – this is a quick way to lose state when it works.

the tradeoff is that if you fill it, then delete an address, it’ll be cleared too

but this does make it a nicer experience in general, and improving creation of addresses is not the scope of this PR

'skeleton': patch
'@shopify/cli-hydrogen': patch
---

Fixed an issue where users without addresses could not add the first one
1 change: 1 addition & 0 deletions _test
Submodule _test added at f8a2db
24 changes: 12 additions & 12 deletions templates/skeleton/app/routes/account.addresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,23 +264,23 @@ export default function Addresses() {
<div className="account-addresses">
<h2>Addresses</h2>
<br />
{!addresses.nodes.length ? (
<p>You have no addresses saved.</p>
) : (
<div>
<div>
<div>
<legend>Create address</legend>
<NewAddressForm />
</div>
<br />
<hr />
<br />
<legend>Create address</legend>
<NewAddressForm key={addresses.nodes.length} />
</div>
<br />
<hr />
<br />
{!addresses.nodes.length ? (
<p>You have no addresses saved.</p>
) : (
<ExistingAddresses
addresses={addresses}
defaultAddress={defaultAddress}
/>
</div>
)}
)}
</div>
</div>
);
}
Expand Down
Loading