Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return promises in onsubmit #2589

Closed

Conversation

askvortsov1
Copy link
Member

This allows extensions using the extend util to react to the server's response with thens. There might be other places we want to do this.

One example of a use case is FriendsOfFlarum/drafts#18

This allows extensions using the `extend` util to react to the server's response with `then`s.
@@ -161,7 +161,7 @@ export default class SignUpModal extends Modal {

const body = this.submitData();

app
return app
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn’t this be pointless/need more changes since the window is reloaded? Any then statement after wouldn’t be able to run.

@KyrneDev
Copy link
Contributor

KyrneDev commented Feb 3, 2021

This really isn’t the solution I would hope for. The reason extensions override the sign up and login modal are because it reloads at the end. It’s great that the mail page can now do this, but it isn’t all that useful compared to these 2.

@askvortsov1
Copy link
Member Author

I think I'm going to close this for now, it's not particularly universal as a solution.

@askvortsov1 askvortsov1 closed this Feb 3, 2021
@SychO9 SychO9 deleted the as/return-promises-in-onsubmit-where-applicable branch January 5, 2023 12:09
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.

2 participants