fix(markets): key details panel crashing (#5683)
This commit is contained in:
parent
cff1818940
commit
9153677a33
@ -210,10 +210,15 @@ export const KeyDetailsInfoPanel = ({
|
|||||||
skip: !featureFlags.SUCCESSOR_MARKETS || !market.proposal?.id,
|
skip: !featureFlags.SUCCESSOR_MARKETS || !market.proposal?.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
const successorProposal =
|
const successorProposal = successorProposalDetails?.proposal as
|
||||||
successorProposalDetails?.proposal as SingleProposal<
|
| SingleProposal<SuccessorMarketProposalDetailsQuery['proposal']>
|
||||||
SuccessorMarketProposalDetailsQuery['proposal']
|
| undefined;
|
||||||
>;
|
|
||||||
|
const successorConfiguration =
|
||||||
|
successorProposal?.terms.change.__typename === 'NewMarket' &&
|
||||||
|
successorProposal.terms.change.successorConfiguration?.__typename ===
|
||||||
|
'SuccessorConfiguration' &&
|
||||||
|
successorProposal.terms.change.successorConfiguration;
|
||||||
|
|
||||||
// The following queries are needed as the parent market could also have been a successor market.
|
// The following queries are needed as the parent market could also have been a successor market.
|
||||||
// Note: the parent market is only passed to this component if the successor markets flag is enabled,
|
// Note: the parent market is only passed to this component if the successor markets flag is enabled,
|
||||||
@ -232,10 +237,9 @@ export const KeyDetailsInfoPanel = ({
|
|||||||
},
|
},
|
||||||
skip: !parentMarket?.proposal?.id,
|
skip: !parentMarket?.proposal?.id,
|
||||||
});
|
});
|
||||||
const parentProposal =
|
const parentProposal = parentSuccessorProposalDetails?.proposal as
|
||||||
parentSuccessorProposalDetails?.proposal as SingleProposal<
|
| SingleProposal<SuccessorMarketProposalDetailsQuery['proposal']>
|
||||||
SuccessorMarketProposalDetailsQuery['proposal']
|
| undefined;
|
||||||
>;
|
|
||||||
|
|
||||||
const assetDecimals = getAsset(market).decimals;
|
const assetDecimals = getAsset(market).decimals;
|
||||||
|
|
||||||
@ -259,16 +263,13 @@ export const KeyDetailsInfoPanel = ({
|
|||||||
</KeyValueTable>
|
</KeyValueTable>
|
||||||
<MarketInfoTable
|
<MarketInfoTable
|
||||||
data={
|
data={
|
||||||
featureFlags.SUCCESSOR_MARKETS
|
featureFlags.SUCCESSOR_MARKETS && successorConfiguration
|
||||||
? {
|
? {
|
||||||
name: market.tradableInstrument.instrument.name,
|
name: market.tradableInstrument.instrument.name,
|
||||||
parentMarketID:
|
parentMarketID:
|
||||||
parentMarketIdData?.market?.parentMarketID || '-',
|
parentMarketIdData?.market?.parentMarketID || '-',
|
||||||
insurancePoolFraction:
|
insurancePoolFraction:
|
||||||
(successorProposal.terms.change.__typename === 'NewMarket' &&
|
successorConfiguration.insurancePoolFraction || '-',
|
||||||
successorProposal.terms.change.successorConfiguration
|
|
||||||
?.insurancePoolFraction) ||
|
|
||||||
'-',
|
|
||||||
status: market.state && MarketStateMapping[market.state],
|
status: market.state && MarketStateMapping[market.state],
|
||||||
tradingMode:
|
tradingMode:
|
||||||
market.tradingMode &&
|
market.tradingMode &&
|
||||||
|
Loading…
Reference in New Issue
Block a user