Skip to content

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Sep 19, 2025

Description

Since we didn't throw WalletPromptClosed but simply return, the form believed if the prompt was closed, the post or comment was submitted successfully and deleted the draft in localStorage.

This was only apparent when going to /wallets, because if we simply close the modal via the x button, we can still see the value in the text input, but the draft in localStorage is gone.

Checklist

Are your changes backward compatible? Please answer below:

yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

8. Drafts are no longer lost if we visit /wallets from the prompt or close the prompt ourselves.

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

Did you use AI for this? If so, how much did it assist you?

no

@@ -1087,6 +1088,7 @@ export function Form ({
await onSubmit(values, ...args)
}
} catch (err) {
if (err instanceof WalletPromptClosed) return
Copy link
Member Author

@ekzyis ekzyis Sep 19, 2025

Choose a reason for hiding this comment

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

I don't like how far away catching the error feels from where the error is thrown, but since WalletPromptClosed is semantically indeed more a submit error than success, it also kind of does make sense to throw it all the way up to here. 🤔

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

Successfully merging this pull request may close these issues.

1 participant