Compare commits

...

2 Commits

Author SHA1 Message Date
Matthew Russell
e21b71fc84
chore: remove unnecessary ts-ignores 2024-02-20 09:24:17 -08:00
Matthew Russell
e941665a29
fix: cache instrument by code 2024-02-20 08:54:17 -08:00
2 changed files with 18 additions and 24 deletions

View File

@ -62,6 +62,9 @@ const cache: InMemoryCacheConfig = {
Account: { Account: {
keyFields: false, keyFields: false,
}, },
Instrument: {
keyFields: ['code'],
},
Delegation: { Delegation: {
keyFields: false, keyFields: false,
// Only get full updates // Only get full updates

View File

@ -140,6 +140,9 @@ const ProposalDetails = ({
); );
} }
case 'UpdateMarketState': { case 'UpdateMarketState': {
const marketPageLink = consoleLink(
CONSOLE_MARKET_PAGE.replace(':marketId', terms.change.market.id)
);
return ( return (
<span> <span>
{featureFlags.UPDATE_MARKET_STATE && {featureFlags.UPDATE_MARKET_STATE &&
@ -161,24 +164,16 @@ const ProposalDetails = ({
</button> </button>
</CopyWithTooltip> </CopyWithTooltip>
<Tooltip description={t('OpenInConsole')} align="center"> <Tooltip description={t('OpenInConsole')} align="center">
<button <Link
className="inline-block px-1" className="inline-block px-1"
onClick={() => { to={marketPageLink}
const marketPageLink = consoleLink( target="_blank"
CONSOLE_MARKET_PAGE.replace(
':marketId',
// @ts-ignore ts doesn't like this field even though its already a string above???
terms.change.market.id
)
);
window.open(marketPageLink, '_blank');
}}
> >
<VegaIcon <VegaIcon
size={20} size={20}
name={VegaIconNames.OPEN_EXTERNAL} name={VegaIconNames.OPEN_EXTERNAL}
/> />
</button> </Link>
</Tooltip> </Tooltip>
</span> </span>
</span> </span>
@ -188,6 +183,10 @@ const ProposalDetails = ({
); );
} }
case 'UpdateMarket': { case 'UpdateMarket': {
const marketPageLink = consoleLink(
CONSOLE_MARKET_PAGE.replace(':marketId', terms.change.marketId)
);
return ( return (
<> <>
<span>{t('UpdateToMarket')}: </span> <span>{t('UpdateToMarket')}: </span>
@ -205,21 +204,13 @@ const ProposalDetails = ({
</button> </button>
</CopyWithTooltip> </CopyWithTooltip>
<Tooltip description={t('OpenInConsole')} align="center"> <Tooltip description={t('OpenInConsole')} align="center">
<button <Link
className="inline-block px-1" className="inline-block px-1"
onClick={() => { target="_blank"
const marketPageLink = consoleLink( to={marketPageLink}
CONSOLE_MARKET_PAGE.replace(
':marketId',
// @ts-ignore ts doesn't like this field even though its already a string above???
terms.change.marketId
)
);
window.open(marketPageLink, '_blank');
}}
> >
<VegaIcon size={20} name={VegaIconNames.OPEN_EXTERNAL} /> <VegaIcon size={20} name={VegaIconNames.OPEN_EXTERNAL} />
</button> </Link>
</Tooltip> </Tooltip>
</span> </span>
</span> </span>