Skip to content

Commit

Permalink
🔀 Merge #1889 to deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Oct 12, 2024
2 parents 1b8ce85 + dbfb862 commit 435f764
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
22 changes: 17 additions & 5 deletions src/components/NFTPortfolio/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
:display-state="nftDisplayState"
:is-nft-book="nftIsNFTBook"
:portfolio-tab="portfolioTab"
:is-content-viewable="!(nftIsNFTBook && !isOwningNFT)"
:is-content-viewable="isContentViewable"
:is-content-downloadable="!nftIsDownloadHidden"
:collect-expiry-time="collectExpiryTime"
@collect="handleClickCollect"
Expand All @@ -39,12 +39,11 @@
</template>

<script>
import { logTrackerEvent } from '~/util/EventLogger';
import nftMixin from '~/mixins/nft';
import walletMixin from '~/mixins/wallet';
export default {
mixins: [nftMixin],
mixins: [nftMixin, walletMixin],
props: {
classId: {
type: String,
Expand All @@ -66,6 +65,10 @@ export default {
type: Boolean,
default: false,
},
isBookshelf: {
type: Boolean,
default: false,
},
},
data() {
Expand All @@ -74,8 +77,17 @@ export default {
};
},
computed: {
ownedNftId() {
return this.collectorMap?.[this.getAddress]?.[0];
},
isContentViewable() {
return this.nftIsNFTBook && this.isBookshelf && this.ownedNftId;
},
nftIdForDetails() {
return this.portfolioTab === 'collected' && this.nftId;
if (this.portfolioTab === 'collected') {
return this.isBookshelf ? this.ownedNftId : this.nftId;
}
return undefined;
},
detailsPageRoute() {
if (this.nftIdForDetails) {
Expand Down
1 change: 1 addition & 0 deletions src/components/NFTPortfolio/MainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
:nft-id="nft.lastOwnedNFTId"
:portfolio-tab="portfolioTab"
:should-fetch-when-visible="true"
:is-bookshelf="isBookshelf"
@load-cover="updatePortfolioGrid"
@click.native="handleItemClick(nft.classId)"
@collect="handleItemCollect(nft.classId)"
Expand Down
5 changes: 4 additions & 1 deletion src/store/modules/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,10 @@ const actions = {
if (classesOrPromise) {
await classesOrPromise;
} else {
await dispatch('fetchCollectedNFTClassesByAddress', { address });
await dispatch('fetchCollectedNFTClassesByAddress', {
address,
nocache: true,
});
}
},
async fetchNFTDisplayStateListByAddress({ commit }, address) {
Expand Down

0 comments on commit 435f764

Please sign in to comment.