From 6f9ca58b567ee67af574b6da4d1e29125ee9bb2b Mon Sep 17 00:00:00 2001 From: Madhab Sahoo Date: Thu, 26 Sep 2024 09:06:25 +0530 Subject: [PATCH] Currency to Uppercase & add message to notification --- .../create-asset-profile-dialog.component.ts | 14 +++++++++++--- .../admin-overview/admin-overview.component.ts | 8 ++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts index 4854975b6..59df26fbf 100644 --- a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts @@ -84,7 +84,9 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy { symbol: this.createAssetProfileForm.get('addSymbol').value }); } else { - const currency = this.createAssetProfileForm.get('addCurrency').value; + const currency = this.createAssetProfileForm + .get('addCurrency') + .value.toUpperCase(); if (currency.length === 3) { const currencies = uniq([...this.customCurrencies, currency]); this.putAdminSetting({ key: PROPERTY_CURRENCIES, value: currencies }); @@ -94,7 +96,8 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy { }); } else { this.notificationService.alert({ - title: $localize`${currency} is an invalid currency!` + title: $localize`${currency} is an invalid currency!`, + message: $localize`Currency should be 3 characters in length` }); } } @@ -146,6 +149,11 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy { .putAdminSetting(key, { value: value || value === false ? JSON.stringify(value) : undefined }) - .pipe(takeUntil(this.unsubscribeSubject)); + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe(() => { + setTimeout(() => { + window.location.reload(); + }, 300); + }); } } 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 9763f960f..41b4791d6 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 @@ -126,11 +126,15 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { if (currency) { if (currency.length === 3) { - const currencies = uniq([...this.customCurrencies, currency]); + const currencies = uniq([ + ...this.customCurrencies, + currency.toUpperCase() + ]); this.putAdminSetting({ key: PROPERTY_CURRENCIES, value: currencies }); } else { this.notificationService.alert({ - title: $localize`${currency} is an invalid currency!` + title: $localize`${currency} is an invalid currency!`, + message: $localize`Currency should be 3 characters in length` }); } }