From df9cff1cf6993a9d22f9bebf8dbe548355c06658 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 18 Dec 2023 19:29:43 +0100 Subject: [PATCH] Improve validation --- .../components/admin-overview/admin-overview.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index 0ab1cb27b..4b3e1f125 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/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!`); + } } }