Browse Source

Various improvements

pull/2409/head
Thomas 2 years ago
parent
commit
54ef36cd65
  1. 2
      apps/api/src/app/benchmark/benchmark.service.ts
  2. 12
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  3. 15
      apps/client/src/app/services/data.service.ts

2
apps/api/src/app/benchmark/benchmark.service.ts

@ -269,8 +269,6 @@ export class BenchmarkService {
return symbolProfileId !== assetProfile.id; return symbolProfileId !== assetProfile.id;
}); });
benchmarks = uniqBy(benchmarks, 'symbolProfileId');
await this.propertyService.put({ await this.propertyService.put({
key: PROPERTY_BENCHMARKS, key: PROPERTY_BENCHMARKS,
value: JSON.stringify(benchmarks) value: JSON.stringify(benchmarks)

12
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 }) .postBenchmark({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => { .subscribe(() => {
setTimeout(() => { this.dataService.updateInfo();
window.location.reload();
}, 300); this.isBenchmark = true;
this.changeDetectorRef.markForCheck();
}); });
} }
@ -190,7 +192,11 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
.deleteBenchmark({ dataSource, symbol }) .deleteBenchmark({ dataSource, symbol })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => { .subscribe(() => {
this.dataService.updateInfo();
this.isBenchmark = false; this.isBenchmark = false;
this.changeDetectorRef.markForCheck();
}); });
} }

15
apps/client/src/app/services/data.service.ts

@ -500,4 +500,19 @@ export class DataService {
couponCode couponCode
}); });
} }
public updateInfo() {
this.http.get<InfoItem>('/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;
});
}
} }

Loading…
Cancel
Save