fix no markets specified behavior
This commit is contained in:
@@ -103,17 +103,21 @@ const getMarketsAndOraclesToLoad = (
|
|||||||
const noMarketsSpecified = !PERP_MARKETS_TO_LOAD && !SPOT_MARKETS_TO_LOAD;
|
const noMarketsSpecified = !PERP_MARKETS_TO_LOAD && !SPOT_MARKETS_TO_LOAD;
|
||||||
|
|
||||||
let perpIndexes = PERP_MARKETS_TO_LOAD;
|
let perpIndexes = PERP_MARKETS_TO_LOAD;
|
||||||
if (!perpIndexes && noMarketsSpecified) {
|
if (!perpIndexes) {
|
||||||
|
if (noMarketsSpecified) {
|
||||||
perpIndexes = sdkConfig.PERP_MARKETS.map((m) => m.marketIndex);
|
perpIndexes = sdkConfig.PERP_MARKETS.map((m) => m.marketIndex);
|
||||||
} else {
|
} else {
|
||||||
perpIndexes = [];
|
perpIndexes = [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let spotIndexes = SPOT_MARKETS_TO_LOAD;
|
let spotIndexes = SPOT_MARKETS_TO_LOAD;
|
||||||
if (!spotIndexes && noMarketsSpecified) {
|
if (!spotIndexes) {
|
||||||
|
if (noMarketsSpecified) {
|
||||||
spotIndexes = sdkConfig.SPOT_MARKETS.map((m) => m.marketIndex);
|
spotIndexes = sdkConfig.SPOT_MARKETS.map((m) => m.marketIndex);
|
||||||
} else {
|
} else {
|
||||||
spotIndexes = [];
|
spotIndexes = [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (perpIndexes.length > 0) {
|
if (perpIndexes.length > 0) {
|
||||||
for (const idx of perpIndexes) {
|
for (const idx of perpIndexes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user