Release v17.016 (from 000a21d8)
Fixes tradingview/charting_library#4599 Fixes tradingview/charting_library#4613 Fixes tradingview/charting_library#4764 Fixes tradingview/charting_library#4801 Fixes tradingview/charting_library#5112
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
ServerTimeCallback,
|
||||
SubscribeBarsCallback,
|
||||
TimescaleMark,
|
||||
SymbolResolveExtension,
|
||||
} from '../../../charting_library/datafeed-api';
|
||||
|
||||
import {
|
||||
@@ -262,9 +263,11 @@ export class UDFCompatibleDatafeedBase implements IExternalDatafeed, IDatafeedQu
|
||||
}
|
||||
}
|
||||
|
||||
public resolveSymbol(symbolName: string, onResolve: ResolveCallback, onError: ErrorCallback): void {
|
||||
public resolveSymbol(symbolName: string, onResolve: ResolveCallback, onError: ErrorCallback, extension?: SymbolResolveExtension): void {
|
||||
logMessage('Resolve requested');
|
||||
|
||||
const currencyCode = extension && extension.currencyCode;
|
||||
|
||||
const resolveRequestStartTime = Date.now();
|
||||
function onResultReady(symbolInfo: LibrarySymbolInfo): void {
|
||||
logMessage(`Symbol resolved: ${Date.now() - resolveRequestStartTime}ms`);
|
||||
@@ -275,6 +278,9 @@ export class UDFCompatibleDatafeedBase implements IExternalDatafeed, IDatafeedQu
|
||||
const params: RequestParams = {
|
||||
symbol: symbolName,
|
||||
};
|
||||
if (currencyCode !== undefined) {
|
||||
params.currencyCode = currencyCode;
|
||||
}
|
||||
|
||||
this._send<ResolveSymbolResponse | UdfErrorResponse>('symbols', params)
|
||||
.then((response: ResolveSymbolResponse | UdfErrorResponse) => {
|
||||
@@ -293,7 +299,7 @@ export class UDFCompatibleDatafeedBase implements IExternalDatafeed, IDatafeedQu
|
||||
throw new Error('UdfCompatibleDatafeed: inconsistent configuration (symbols storage)');
|
||||
}
|
||||
|
||||
this._symbolsStorage.resolveSymbol(symbolName).then(onResultReady).catch(onError);
|
||||
this._symbolsStorage.resolveSymbol(symbolName, currencyCode).then(onResultReady).catch(onError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user