Skip to content

Commit

Permalink
fix sonarqube
Browse files Browse the repository at this point in the history
  • Loading branch information
marxeille committed Jul 5, 2024
1 parent cfed676 commit 9999ef9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const AllNetworkTxItem: FC<{
const { priceStore, chainStore } = useStore();
const fiat = priceStore.defaultVsCurrency;
if (!item) return;
console.log(item, "item");
let currency = unknownToken;

if (item.tokenInfos?.length > 0 && item.tokenInfos[0]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,32 @@ import { urlTxHistory } from "@src/common/constants";
import { OWEmpty } from "@src/components/empty";
import get from "lodash/get";

function EnegyAndFee({ item }) {
return (
<>
{item.energyUsageTotal ? (
<ItemReceivedToken
label={"Energy"}
valueDisplay={`${maskedNumber(item.energyUsageTotal)}`}
btnCopy={false}
/>
) : null}
{item.netFee || item.netUsage ? (
<ItemReceivedToken
label={"Bandwidth"}
valueDisplay={`${maskedNumber(
new Int(item.netFee || 0)
.add(new Int(item.netUsage || 0).mul(new Int(1e3)))
.div(new Int(1e3))
.toString()
)}`}
btnCopy={false}
/>
) : null}
</>
);
}

export const TronDetailTx: FunctionComponent = observer((props) => {
const { chainStore, priceStore } = useStore();

Expand All @@ -57,8 +83,7 @@ export const TronDetailTx: FunctionComponent = observer((props) => {
const [loading, setLoading] = useState(false);

const { item, currency } = route.params;
const { txID: hash, chain, transactionType } = item;
console.log(item, detail, "item detail");
const { txID: hash } = item;

const getHistoryDetail = async () => {
try {
Expand Down Expand Up @@ -217,25 +242,7 @@ export const TronDetailTx: FunctionComponent = observer((props) => {
}
btnCopy={false}
/>
{item.energyUsageTotal ? (
<ItemReceivedToken
label={"Energy"}
valueDisplay={`${maskedNumber(item.energyUsageTotal)}`}
btnCopy={false}
/>
) : null}
{item.netFee || item.netUsage ? (
<ItemReceivedToken
label={"Bandwidth"}
valueDisplay={`${maskedNumber(
new Int(item.netFee || 0)
.add(new Int(item.netUsage || 0).mul(new Int(1e3)))
.div(new Int(1e3))
.toString()
)}`}
btnCopy={false}
/>
) : null}
<EnegyAndFee item={item} />

<ItemReceivedToken
label={"Fee"}
Expand Down

0 comments on commit 9999ef9

Please sign in to comment.