fix: prevent users from selecting null as a country during signup

Co-authored-by: nig <nig@tutao.de>
This commit is contained in:
toj 2025-12-04 15:34:54 +01:00
parent 52c86f1074
commit 5e85e213cb
3 changed files with 4 additions and 8 deletions

View file

@ -57,13 +57,7 @@ export function renderCountryDropdown(params: {
return m(DropDownSelector, { return m(DropDownSelector, {
label: params.label ?? "invoiceCountry_label", label: params.label ?? "invoiceCountry_label",
helpLabel: params.helpLabel, helpLabel: params.helpLabel,
items: [ items: [...dropdownCountries(), { value: null, name: lang.get("choose_label"), selectable: false }],
...dropdownCountries(),
{
value: null,
name: lang.get("choose_label"),
},
],
selectedValue: params.selectedCountry, selectedValue: params.selectedCountry,
selectionChangedHandler: params.onSelectionChanged, selectionChangedHandler: params.onSelectionChanged,
}) })

View file

@ -123,7 +123,8 @@ export class InvoiceAndPaymentDataPage implements WizardPageN<UpgradeSubscriptio
disabled: disabled:
(this._selectedPaymentMethod() === PaymentMethodType.CreditCard && (this._selectedPaymentMethod() === PaymentMethodType.CreditCard &&
this.ccViewModel.validateCreditCardPaymentData() != null) || this.ccViewModel.validateCreditCardPaymentData() != null) ||
(this._selectedPaymentMethod() === PaymentMethodType.Paypal && !this.isPaypalLinked()), (this._selectedPaymentMethod() === PaymentMethodType.Paypal && !this.isPaypalLinked()) ||
this._invoiceDataInput?.selectedCountry() == null,
}), }),
), ),
] ]

View file

@ -441,6 +441,7 @@ class RedeemGiftCardPage implements WizardPageN<RedeemGiftCardModel> {
.catch(ofClass(UserError, showUserError)) .catch(ofClass(UserError, showUserError))
.catch(ofClass(CancelledError, noOp)) .catch(ofClass(CancelledError, noOp))
}, },
disabled: !this.confirmed || this.country == null,
}), }),
), ),
]) ])