3434 tableWrapperClasses =" md:min-w-auto md:p-0"
3535 tableClasses =" md:min-w-[1000px]"
3636 :scrollable =" !mobile"
37- :hide-values =" {text: $t('message.toggle-values'), value: hide}"
37+ :hide-values =" { text: $t('message.toggle-values'), value: hide }"
3838 @hide-value =" onHide"
3939 @onSearchClear =" onSearch('')"
4040 @on-input =" (e: Event) => onSearch((e.target as HTMLInputElement).value)"
@@ -122,7 +122,13 @@ import { useBalancesStore } from "@/common/stores/balances";
122122import { usePricesStore } from " @/common/stores/prices" ;
123123import { useConfigStore } from " @/common/stores/config" ;
124124import { NATIVE_CURRENCY , UPDATE_LEASES } from " @/config/global" ;
125- import { formatUsd , formatDecAsUsd , formatTokenBalance , formatMobileAmount , formatMobileUsd } from " @/common/utils/NumberFormatUtils" ;
125+ import {
126+ formatUsd ,
127+ formatDecAsUsd ,
128+ formatTokenBalance ,
129+ formatMobileAmount ,
130+ formatMobileUsd
131+ } from " @/common/utils/NumberFormatUtils" ;
126132import { useRouter } from " vue-router" ;
127133import type { IAction } from " ./single-lease/Action.vue" ;
128134import Action from " ./single-lease/Action.vue" ;
@@ -159,22 +165,23 @@ let openMenuId: string | null;
159165
160166let timeOut: NodeJS .Timeout ;
161167
162- const columns = computed <TableColumnProps []>(() => isMobile ()
163- ? [
164- { label: i18n .t (" message.asset" ), variant: " left" },
165- { label: i18n .t (" message.lease-size" ) },
166- { label: i18n .t (" message.pnl" ) },
167- { label: " " , class: " !flex-none w-[40px]" }
168- ]
169- : [
170- { label: i18n .t (" message.lease" ), variant: " left" , class: " max-w-[150px]" },
171- { label: i18n .t (" message.asset" ), variant: " left" },
172- { label: i18n .t (" message.type" ), variant: " left" , class: " max-w-[45px]" },
173- { label: i18n .t (" message.pnl" ), class: " max-w-[200px]" },
174- { label: i18n .t (" message.lease-size" ) },
175- { label: i18n .t (" message.liquidation-lease-table" ), class: " max-w-[200px]" },
176- { label: " " , class: " max-w-[220px]" }
177- ]
168+ const columns = computed <TableColumnProps []>(() =>
169+ isMobile ()
170+ ? [
171+ { label: i18n .t (" message.asset" ), variant: " left" },
172+ { label: i18n .t (" message.lease-size" ) },
173+ { label: i18n .t (" message.pnl" ) },
174+ { label: " " , class: " !flex-none w-[40px]" }
175+ ]
176+ : [
177+ { label: i18n .t (" message.lease" ), variant: " left" , class: " max-w-[150px]" },
178+ { label: i18n .t (" message.asset" ), variant: " left" },
179+ { label: i18n .t (" message.type" ), variant: " left" , class: " max-w-[45px]" },
180+ { label: i18n .t (" message.pnl" ), class: " max-w-[200px]" },
181+ { label: i18n .t (" message.lease-size" ) },
182+ { label: i18n .t (" message.liquidation-lease-table" ), class: " max-w-[200px]" },
183+ { label: " " , class: " max-w-[220px]" }
184+ ]
178185);
179186
180187const isProtocolDisabled = computed (() => {
@@ -255,22 +262,31 @@ const leasesData = computed<TableRowItemProps[]>(() => {
255262 component : () =>
256263 loading
257264 ? h (" div" , { class: " skeleton-box mb-2 rounded-[4px] w-[70px] h-[20px]" })
258- : h (" span" , {
259- class: ` text-14 font-normal ${pnlData .status ? " text-typography-success" : " text-typography-error" } `
260- }, ` ${pnlData .status ? " +" : " " }${pnlData .percent }% ` ),
265+ : h (
266+ " span" ,
267+ {
268+ class: ` text-14 font-normal ${pnlData .status ? " text-typography-success" : " text-typography-error" } `
269+ },
270+ ` ${pnlData .status ? " +" : " " }${pnlData .percent }% `
271+ ),
261272 click: navigate ,
262273 class: " cursor-pointer"
263274 },
264275 {
265- component : () => h <IAction >(Action , {
266- lease: item ,
267- showClose: isOpened && ! displayData .inProgressType ,
268- showDetails: true ,
269- key: ` mob-action-${item .address } ` ,
270- opened: openMenuId == item .address ,
271- onClick : (data : boolean ) => { openMenuId = data ? item .address : null ; },
272- onSharePnl : () => { sharePnlDialog .value ?.show (item , displayData ); }
273- }),
276+ component : () =>
277+ h <IAction >(Action , {
278+ lease: item ,
279+ showClose: isOpened && ! displayData .inProgressType ,
280+ showDetails: true ,
281+ key: ` mob-action-${item .address } ` ,
282+ opened: openMenuId == item .address ,
283+ onClick : (data : boolean ) => {
284+ openMenuId = data ? item .address : null ;
285+ },
286+ onSharePnl : () => {
287+ sharePnlDialog .value ?.show (item , displayData );
288+ }
289+ }),
274290 class: " !flex-none w-[40px]"
275291 }
276292 ]
@@ -410,6 +426,7 @@ function getAssetIcon(item: LeaseInfo) {
410426 if (item .status === " opening" && item .opening_info ) {
411427 return configStore .assetIcons ?.[` ${item .opening_info .loan .ticker }@${item .protocol } ` ]! ;
412428 }
429+ return configStore .assetIcons ?.[` ${item .debt .ticker }@${item .protocol } ` ] as string ;
413430 }
414431 return configStore .assetIcons ?.[` ${positionTicker }@${item .protocol } ` ] as string ;
415432}
@@ -425,9 +442,9 @@ function getAsset(lease: LeaseInfo) {
425442 const asset = getCurrencyByDenom (item ?.ibcData as string );
426443 return asset ;
427444 } else if (positionType === " Short" ) {
428- const positionTicker = lease .etl_data ?. lease_position_ticker ?? lease . amount .ticker ;
429- if (! positionTicker ) return null ;
430- const item = getCurrencyByTicker (positionTicker as string );
445+ const debtTicker = lease .debt .ticker ;
446+ if (! debtTicker ) return null ;
447+ const item = getCurrencyByTicker (debtTicker as string );
431448 const asset = getCurrencyByDenom (item ?.ibcData as string );
432449 return asset ;
433450 }
@@ -527,7 +544,6 @@ function setLeases() {
527544 if (! (amount .isZero () || am .isZero ())) {
528545 pnl_percent .value = am .quo (dp .add (rp )).mul (new Dec (100 ));
529546 }
530-
531547 } catch (e ) {
532548 Logger .error (e );
533549 }
0 commit comments