Skip to content

Commit af74fc8

Browse files
authored
Merge pull request #1194 from crypto-com/dev
Merge Dev to Master
2 parents cde90a6 + 1cf91fa commit af74fc8

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ All notable changes to this project will be documented in this file.
77
*Released*
88
## [v1.1.1] - 2022-07-15
99
### Bug fixes
10-
- Clean up duplicated rewards & delegations
10+
- Clean up duplicated rewards, delegations
11+
- Incorrect display of Mainnet Cronos NFT transfer history for Testnet wallet
1112
## [v1.1.0] - 2022-07-11
1213
### Additions
1314
- View Governance Voting History

src/pages/nft/components/ChainSelect.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { Select } from 'antd';
22
import React, { useState } from 'react';
3+
import { useRecoilValue } from 'recoil';
34
import { useCronosEvmAsset, useCronosTendermintAsset } from '../../../hooks/useCronosEvmAsset';
45
import { UserAsset } from '../../../models/UserAsset';
6+
import { sessionState } from '../../../recoil/atom';
7+
import { checkIfTestnet } from '../../../utils/utils';
58

69
interface IChainSelectProps {
710
onChangeAsset: (asset: UserAsset | undefined) => void;
@@ -11,7 +14,11 @@ const ChainSelect = (props: IChainSelectProps) => {
1114
const cronosTendermintAsset = useCronosTendermintAsset();
1215
const cronosEvmAsset = useCronosEvmAsset();
1316
const [currentAsset, setCurrentAsset] = useState(cronosTendermintAsset);
14-
const selectableAssets = [cronosTendermintAsset, cronosEvmAsset];
17+
const currentSession = useRecoilValue(sessionState);
18+
const selectableAssets = [
19+
cronosTendermintAsset,
20+
...(!checkIfTestnet(currentSession.wallet.config.network) ? [cronosEvmAsset] : []),
21+
];
1522

1623
return (
1724
<Select

src/pages/nft/tabs/transactions/Cronos.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ const CronosNFTTransactionList = () => {
112112
}}
113113
columns={NftTransactionColumns}
114114
dataSource={nftTransfers}
115-
rowKey={record => record.tx_hash}
115+
rowKey={record =>
116+
`${record.tx_hash}_${record.event_type}_${record.token_address}_${record.token_name}`
117+
}
116118
/>
117119
);
118120
};

src/service/rpc/indexing/nft/cronos/CronosNftIndexingAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class CronosNftIndexingAPI {
7171
return [];
7272
}
7373

74-
nftTxsList.push(...response.data.nft_txs);
74+
nftTxsList.push(...response.data.nft_txs.filter(tx => tx.event_type === 'Transfer'));
7575

7676
let txsResponse: NftTxsResponse = response;
7777

@@ -85,7 +85,7 @@ export class CronosNftIndexingAPI {
8585
txsResponse = pageNftsListRequest.data;
8686
paginationPage++;
8787
if (txsResponse.code === 0) {
88-
nftTxsList.push(...txsResponse.data.nft_txs);
88+
nftTxsList.push(...txsResponse.data.nft_txs.filter(tx => tx.event_type === 'Transfer'));
8989
}
9090
}
9191

0 commit comments

Comments
 (0)