Feature/improve premium data provider handling in getQuotes() (#4590)
* Improve premium data provider handling in getQuotes()
This commit is contained in:
parent
dfa940c1b4
commit
56fcafaa12
@ -18,6 +18,7 @@ import {
|
|||||||
DATE_FORMAT,
|
DATE_FORMAT,
|
||||||
getCurrencyFromSymbol,
|
getCurrencyFromSymbol,
|
||||||
getStartOfUtcDate,
|
getStartOfUtcDate,
|
||||||
|
isCurrency,
|
||||||
isDerivedCurrency
|
isDerivedCurrency
|
||||||
} from '@ghostfolio/common/helper';
|
} from '@ghostfolio/common/helper';
|
||||||
import {
|
import {
|
||||||
@ -468,17 +469,21 @@ export class DataProviderService {
|
|||||||
)) {
|
)) {
|
||||||
const dataProvider = this.getDataProvider(DataSource[dataSource]);
|
const dataProvider = this.getDataProvider(DataSource[dataSource]);
|
||||||
|
|
||||||
if (
|
const symbols = assetProfileIdentifiers
|
||||||
|
.filter(({ symbol }) => {
|
||||||
|
if (isCurrency(getCurrencyFromSymbol(symbol))) {
|
||||||
|
// Keep non-derived currencies
|
||||||
|
return !isDerivedCurrency(getCurrencyFromSymbol(symbol));
|
||||||
|
} else if (
|
||||||
dataProvider.getDataProviderInfo().isPremium &&
|
dataProvider.getDataProviderInfo().isPremium &&
|
||||||
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') &&
|
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') &&
|
||||||
user?.subscription.type === 'Basic'
|
user?.subscription.type === 'Basic'
|
||||||
) {
|
) {
|
||||||
continue;
|
// Skip symbols of Premium data providers for users without subscription
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const symbols = assetProfileIdentifiers
|
return true;
|
||||||
.filter(({ symbol }) => {
|
|
||||||
return !isDerivedCurrency(getCurrencyFromSymbol(symbol));
|
|
||||||
})
|
})
|
||||||
.map(({ symbol }) => {
|
.map(({ symbol }) => {
|
||||||
return symbol;
|
return symbol;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user