Bugfix/fix data source of fear and greed index (#663)
* Encode data source * Update changelog
This commit is contained in:
@@ -4,9 +4,8 @@ import { DataService } from '@ghostfolio/client/services/data.service';
|
||||
import { UserService } from '@ghostfolio/client/services/user/user.service';
|
||||
import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config';
|
||||
import { resetHours } from '@ghostfolio/common/helper';
|
||||
import { User } from '@ghostfolio/common/interfaces';
|
||||
import { InfoItem, User } from '@ghostfolio/common/interfaces';
|
||||
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
|
||||
import { DataSource } from '@prisma/client';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
@@ -19,6 +18,7 @@ export class HomeMarketComponent implements OnDestroy, OnInit {
|
||||
public fearAndGreedIndex: number;
|
||||
public hasPermissionToAccessFearAndGreedIndex: boolean;
|
||||
public historicalData: HistoricalDataItem[];
|
||||
public info: InfoItem;
|
||||
public isLoading = true;
|
||||
public readonly numberOfDays = 90;
|
||||
public user: User;
|
||||
@@ -33,6 +33,7 @@ export class HomeMarketComponent implements OnDestroy, OnInit {
|
||||
private dataService: DataService,
|
||||
private userService: UserService
|
||||
) {
|
||||
this.info = this.dataService.fetchInfo();
|
||||
this.isLoading = true;
|
||||
|
||||
this.userService.stateChanged
|
||||
@@ -49,7 +50,7 @@ export class HomeMarketComponent implements OnDestroy, OnInit {
|
||||
if (this.hasPermissionToAccessFearAndGreedIndex) {
|
||||
this.dataService
|
||||
.fetchSymbolItem({
|
||||
dataSource: DataSource.RAKUTEN,
|
||||
dataSource: this.info.fearAndGreedDataSource,
|
||||
includeHistoricalData: this.numberOfDays,
|
||||
symbol: ghostfolioFearAndGreedIndexSymbol
|
||||
})
|
||||
|
@@ -141,7 +141,7 @@ export class DataService {
|
||||
includeHistoricalData,
|
||||
symbol
|
||||
}: {
|
||||
dataSource: DataSource;
|
||||
dataSource: DataSource | string;
|
||||
includeHistoricalData?: number;
|
||||
symbol: string;
|
||||
}) {
|
||||
|
Reference in New Issue
Block a user