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, {
label: params.label ?? "invoiceCountry_label",
helpLabel: params.helpLabel,
items: [
...dropdownCountries(),
{
value: null,
name: lang.get("choose_label"),
},
],
items: [...dropdownCountries(), { value: null, name: lang.get("choose_label"), selectable: false }],
selectedValue: params.selectedCountry,
selectionChangedHandler: params.onSelectionChanged,
})

View file

@ -123,7 +123,8 @@ export class InvoiceAndPaymentDataPage implements WizardPageN<UpgradeSubscriptio
disabled:
(this._selectedPaymentMethod() === PaymentMethodType.CreditCard &&
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(CancelledError, noOp))
},
disabled: !this.confirmed || this.country == null,
}),
),
])