diff --git a/apps/api/src/app/endpoints/watchlist/watchlist.service.ts b/apps/api/src/app/endpoints/watchlist/watchlist.service.ts index 397f97a9a..08f62706d 100644 --- a/apps/api/src/app/endpoints/watchlist/watchlist.service.ts +++ b/apps/api/src/app/endpoints/watchlist/watchlist.service.ts @@ -120,13 +120,13 @@ export class WatchlistService { ); return { dataSource, - symbol, performances: { allTimeHigh: { date: ath?.date, performancePercent } - } + }, + symbol }; }) ); diff --git a/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts b/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts index 1f3829c58..33f63dfa0 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 @@ -6,6 +6,7 @@ import { User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; +import { BenchmarkTrend } from '@ghostfolio/common/types'; import { GfBenchmarkComponent } from '@ghostfolio/ui/benchmark'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; @@ -118,17 +119,17 @@ export class HomeWatchlistComponent implements OnDestroy, OnInit { .fetchWatchlist() .pipe(takeUntil(this.unsubscribeSubject)) .subscribe(({ watchlist }) => { - this.watchlist = watchlist.map( - ({ dataSource, performances, symbol }) => ({ + this.watchlist = watchlist + .map(({ dataSource, performances, symbol }) => ({ dataSource, performances, symbol, marketCondition: null, name: symbol, - trend50d: 'UNKNOWN', - trend200d: 'UNKNOWN' - }) - ); + trend50d: 'UNKNOWN' as BenchmarkTrend, + trend200d: 'UNKNOWN' as BenchmarkTrend + })) + .sort((a, b) => a.name.localeCompare(b.name)); this.changeDetectorRef.markForCheck(); });