Skip to content

Commit

Permalink
🐛 Fix duplicated key in events (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiJun0827 authored Nov 23, 2022
1 parent 4f99e8c commit 321d85f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mixins/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ export default {
const historyInDB = data.list;
const eventMap = new Map();
historyOnChain.forEach(e => {
eventMap.set(`${e.txHash}-${e.nftId}`, e);
eventMap.set(`${e.txHash}-${e.nftId}-${e.event}`, e);
});
historyInDB.forEach(e => {
const key = `${e.txHash}-${e.nftId}`;
const key = `${e.txHash}-${e.nftId}-${e.event}`;
if (eventMap.has(key)) {
eventMap.get(key).price = e.price;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/nft/class/_classId/_nftId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<ul class="flex flex-col gap-[24px] w-full laptop:px-[24px]">
<NFTMessage
v-for="m in messageList"
:key="m.txHash"
:key="`${m.txHash}-${m.event}`"
:type="m.event"
:tx-hash="m.txHash"
:from-type="m.fromType"
Expand Down

0 comments on commit 321d85f

Please sign in to comment.