File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
backend/src/api/controllers
frontend/src/view/pages/user/components Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,33 @@ export class UserController {
318318 this . excludeL2TransactionTypes
319319 )
320320
321+ // This is a workaround to show the collateral asset row
322+ // at the top of the assets table when the exchange is frozen
323+ // and user has other perpetual assets but no collateral asset.
324+ // This is because that's where we show the 'Escape' button.
325+ if (
326+ context . tradingMode === 'perpetual' &&
327+ context . freezeStatus === 'frozen' &&
328+ collateralAsset !== undefined &&
329+ ! hideAllAssets &&
330+ assetEntries . length > 0
331+ ) {
332+ // As per logic before, collateral asset is always the first one
333+ const topAsset = assetEntries [ 0 ]
334+ if ( topAsset && topAsset . asset . hashOrId !== collateralAsset . assetId ) {
335+ assetEntries . unshift ( {
336+ asset : {
337+ hashOrId : collateralAsset . assetId ,
338+ } ,
339+ balance : 0n ,
340+ value : 0n ,
341+ vaultOrPositionId : topAsset . vaultOrPositionId ,
342+ fundingPayment : undefined ,
343+ action : 'ESCAPE' ,
344+ } )
345+ }
346+ }
347+
321348 const content = renderUserPage ( {
322349 context,
323350 starkKey,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export function UserAssetsTable(props: UserAssetsTableProps) {
6666 </ span >
6767 { props . tradingMode === 'perpetual' && (
6868 < span className = "mt-2 text-xxs text-zinc-500" >
69- { entry . value
69+ { entry . value !== undefined
7070 ? formatWithDecimals ( entry . value , 2 , { prefix : '$' } )
7171 : 'Unknown price' }
7272 </ span >
You can’t perform that action at this time.
0 commit comments