feat(trading): show positions for all markets (#3868)

This commit is contained in:
Bartłomiej Głownia 2023-05-22 21:55:15 +02:00 committed by GitHub
parent 3aa0e974c2
commit 522eb521b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -130,6 +130,13 @@ export const closedMarketsWithDataProvider = makeDerivedDataProvider<
addData(parts[0] as Market[], parts[1] as MarketData[])
);
export const allMarketsWithDataProvider = makeDerivedDataProvider<
MarketMaybeWithData[],
never
>([marketsProvider, marketsDataProvider], (parts) =>
addData(parts[0] as Market[], parts[1] as MarketData[])
);
export type MarketMaybeWithDataAndCandles = MarketMaybeWithData &
MarketMaybeWithCandles;

View File

@ -14,7 +14,7 @@ import type {
MarketMaybeWithData,
MarketDataQueryVariables,
} from '@vegaprotocol/markets';
import { marketsWithDataProvider } from '@vegaprotocol/markets';
import { allMarketsWithDataProvider } from '@vegaprotocol/markets';
import type {
PositionsQuery,
PositionFieldsFragment,
@ -308,7 +308,8 @@ export const positionsMetricsProvider = makeDerivedDataProvider<
[
positionsDataProvider,
accountsDataProvider,
(callback, client) => marketsWithDataProvider(callback, client, undefined),
(callback, client) =>
allMarketsWithDataProvider(callback, client, undefined),
marginsDataProvider,
],
([positions, accounts, marketsData, margins], variables) => {