Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Bugfix/missing loading indicator in benchmarks table on markets page (#7634)
Thomas Kaulaeaec40c8f01
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7419b9db57..e4ae83249b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Fixed- Fixed the missing currency conversion of the dividends on the analysis page+- Fixed the missing error state in the watchlist+- Fixed the missing loading indicator in the benchmarks of the markets overview## 3.51.0 - 2026-08-14diff --git a/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts b/apps/client/src/app/components/home-watchlist/home-watchlist.component.tsindex 97fa6f744d..7492e4e928 100644--- a/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts+++ b/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts@@ -128,10 +128,17 @@ export class GfHomeWatchlistComponent implements OnInit {this.dataService.fetchWatchlist().pipe(takeUntilDestroyed(this.destroyRef))- .subscribe(({ watchlist }) => {- this.watchlist = watchlist;+ .subscribe({+ error: () => {+ this.watchlist = [];++ this.changeDetectorRef.markForCheck();+ },+ next: ({ watchlist }) => {+ this.watchlist = watchlist ?? [];- this.changeDetectorRef.markForCheck();+ this.changeDetectorRef.markForCheck();+ }});}diff --git a/apps/client/src/app/components/markets/markets.component.ts b/apps/client/src/app/components/markets/markets.component.tsindex 7c69fede07..0317ce6480 100644--- a/apps/client/src/app/components/markets/markets.component.ts+++ b/apps/client/src/app/components/markets/markets.component.ts@@ -43,7 +43,7 @@ import { DeviceDetectorService } from 'ngx-device-detector';templateUrl: './markets.html'})export class GfMarketsComponent implements OnInit {- protected readonly benchmarks = signal<Benchmark[]>([]);+ protected readonly benchmarks = signal<Benchmark[] | undefined>(undefined);protected readonly deviceType = computed(() => this.deviceDetectorService.deviceInfo().deviceType@@ -117,8 +117,13 @@ export class GfMarketsComponent implements OnInit {this.dataService.fetchBenchmarks().pipe(takeUntilDestroyed(this.destroyRef))- .subscribe(({ benchmarks }) => {- this.benchmarks.set(benchmarks);+ .subscribe({+ error: () => {+ this.benchmarks.set([]);+ },+ next: ({ benchmarks }) => {+ this.benchmarks.set(benchmarks ?? []);+ }});}diff --git a/apps/client/src/app/components/markets/markets.html b/apps/client/src/app/components/markets/markets.htmlindex bd9013a00e..d834dfd0e8 100644--- a/apps/client/src/app/components/markets/markets.html+++ b/apps/client/src/app/components/markets/markets.html@@ -56,7 +56,7 @@[showSymbol]="false"[user]="user"/>- @if (benchmarks()?.length > 0) {+ @if (benchmarks()?.length) {<divclass="gf-text-wrap-balance line-height-1 mt-3 text-center text-muted">diff --git a/libs/ui/src/lib/benchmark/benchmark.component.html b/libs/ui/src/lib/benchmark/benchmark.component.htmlindex 296e0ce171..556b9875f5 100644--- a/libs/ui/src/lib/benchmark/benchmark.component.html+++ b/libs/ui/src/lib/benchmark/benchmark.component.html@@ -216,7 +216,7 @@</table></div>-@if (isLoading) {+@if (isLoading()) {<ngx-skeleton-loaderanimation="pulse"class="px-4 py-3"diff --git a/libs/ui/src/lib/benchmark/benchmark.component.ts b/libs/ui/src/lib/benchmark/benchmark.component.tsindex 0d9aba0ca0..4f76978d45 100644--- a/libs/ui/src/lib/benchmark/benchmark.component.ts+++ b/libs/ui/src/lib/benchmark/benchmark.component.ts@@ -63,7 +63,7 @@ import { BenchmarkDetailDialogParams } from './benchmark-detail-dialog/interfacetemplateUrl: './benchmark.component.html'})export class GfBenchmarkComponent {- public readonly benchmarks = input.required<Benchmark[]>();+ public readonly benchmarks = input<Benchmark[]>();public readonly deviceType = input.required<string>();public readonly hasPermissionToDeleteItem = input<boolean>();public readonly locale = input(getLocale());@@ -76,6 +76,7 @@ export class GfBenchmarkComponent {protected readonly sort = viewChild(MatSort);protected readonly dataSource = new MatTableDataSource<Benchmark>([]);+protected readonly displayedColumns = computed(() => {return [...(this.showIcon() ? ['icon'] : []),@@ -89,7 +90,11 @@ export class GfBenchmarkComponent {'actions'];});- protected isLoading = true;++ protected readonly isLoading = computed(() => {+ return !this.benchmarks();+ });+protected readonly isNumber = isNumber;protected readonly resolveMarketCondition = resolveMarketCondition;protected readonly round = round;@@ -110,8 +115,8 @@ export class GfBenchmarkComponent {this.dataSource.sortingDataAccessor = getLowercase;this.dataSource.sort = this.sort() ?? null;-- this.isLoading = false;+ } else {+ this.dataSource.data = [];}});