From 54ef36cd656722d73fdb99bd34387fc3d9b212f2 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Mon, 2 Oct 2023 20:28:37 +0200 Subject: [PATCH] Various improvements --- apps/api/src/app/benchmark/benchmark.service.ts | 2 -- .../asset-profile-dialog.component.ts | 12 +++++++++--- apps/client/src/app/services/data.service.ts | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/apps/api/src/app/benchmark/benchmark.service.ts b/apps/api/src/app/benchmark/benchmark.service.ts index ec96666c2..7fe1911a4 100644 --- a/apps/api/src/app/benchmark/benchmark.service.ts +++ b/apps/api/src/app/benchmark/benchmark.service.ts @@ -269,8 +269,6 @@ export class BenchmarkService { return symbolProfileId !== assetProfile.id; }); - benchmarks = uniqBy(benchmarks, 'symbolProfileId'); - await this.propertyService.put({ key: PROPERTY_BENCHMARKS, value: JSON.stringify(benchmarks) diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index 1f8cf6a66..bef984729 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -146,9 +146,11 @@ export class AssetProfileDialog implements OnDestroy, OnInit { .postBenchmark({ dataSource, symbol }) .pipe(takeUntil(this.unsubscribeSubject)) .subscribe(() => { - setTimeout(() => { - window.location.reload(); - }, 300); + this.dataService.updateInfo(); + + this.isBenchmark = true; + + this.changeDetectorRef.markForCheck(); }); } @@ -190,7 +192,11 @@ export class AssetProfileDialog implements OnDestroy, OnInit { .deleteBenchmark({ dataSource, symbol }) .pipe(takeUntil(this.unsubscribeSubject)) .subscribe(() => { + this.dataService.updateInfo(); + this.isBenchmark = false; + + this.changeDetectorRef.markForCheck(); }); } diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index cf6aad513..5cc955af2 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -500,4 +500,19 @@ export class DataService { couponCode }); } + + public updateInfo() { + this.http.get('/api/v1/info').subscribe((info) => { + const utmSource = <'ios' | 'trusted-web-activity'>( + window.localStorage.getItem('utm_source') + ); + + info.globalPermissions = filterGlobalPermissions( + info.globalPermissions, + utmSource + ); + + (window as any).info = info; + }); + } }