Skip to content

fix: don't trigger submit action twice #5658

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

Merged
merged 9 commits into from
Nov 18, 2020
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
3 changes: 2 additions & 1 deletion app/components/forms/admin/settings/billing.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export default class Billing extends Component.extend(FormMixin) {
}

@action
submit() {
submit(e) {
e.preventDefault();
this.onValid(() => {
this.save();
});
Expand Down
3 changes: 2 additions & 1 deletion app/components/forms/login-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export default class LoginForm extends Component.extend(FormMixin) {
}

@action
async submit() {
async submit(e) {
e.preventDefault();
this.onValid(async() => {
const credentials = { username: this.identification, password: this.password };
const authenticator = 'authenticator:jwt';
Expand Down
2 changes: 1 addition & 1 deletion app/components/forms/orders/order-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default Component.extend(FormMixin, {
};

const companyValidation = {
rules : [
rules: [
{
type : 'empty',
prompt : this.l10n.t('Please enter your company')
Expand Down
3 changes: 2 additions & 1 deletion app/components/forms/user-payment-info-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ export default class UserPaymentInfoForm extends Component.extend(FormMixin) {
}

@action
submit() {
submit(e) {
e.preventDefault();
this.onValid(async() => {
this.set('isLoading', true);
try {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/forms/admin/settings/billing.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form class="ui form" {{action 'submit' on='submit'}}>
<form class="ui form">
<h3 class="ui header">
{{t 'Invoice Handling'}}
</h3>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/forms/login-form.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="ui stackable {{unless this.noSocial 'three' 'one'}} column doubling centered grid">
<div class="column">
<form class="ui large form" autocomplete="off" {{action 'submit' on='submit'}}>
<form class="ui large form" autocomplete="off">
<div class="ui aligned segment basic no margin no padding">
<h3 class="weight-400">{{t 'Login'}}</h3>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/forms/user-payment-info-form.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form class="ui form {{if this.isLoading 'loading'}}" {{action 'submit' on='submit'}}>
<form class="ui form {{if this.isLoading 'loading'}}">
<h3 class="ui header">
{{t 'Payment Information'}}
</h3>
Expand Down