Browse Source

Improve validation

pull/2761/head
Thomas Kaul 2 years ago
parent
commit
df9cff1cf6
  1. 8
      apps/client/src/app/components/admin-overview/admin-overview.component.ts

8
apps/client/src/app/components/admin-overview/admin-overview.component.ts

@ -119,8 +119,12 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
const currency = prompt($localize`Please add a currency:`);
if (currency) {
const currencies = uniq([...this.customCurrencies, currency]);
this.putAdminSetting({ key: PROPERTY_CURRENCIES, value: currencies });
if (currency.length === 3) {
const currencies = uniq([...this.customCurrencies, currency]);
this.putAdminSetting({ key: PROPERTY_CURRENCIES, value: currencies });
} else {
alert($localize`${currency} is an invalid currency!`);
}
}
}

Loading…
Cancel
Save