fix: Reset collectible details after exiting details page (#16231)
This commit is contained in:
parent
16d0df694c
commit
f1904d9ef8
|
@ -112,6 +112,10 @@ QtObject:
|
||||||
error "error fetching collectible details: ", response.error
|
error "error fetching collectible details: ", response.error
|
||||||
return
|
return
|
||||||
|
|
||||||
|
proc resetDetailedCollectible*(self: Controller) {.slot.} =
|
||||||
|
self.detailedEntry = newCollectibleDetailsEmptyEntry()
|
||||||
|
self.detailedEntryChanged()
|
||||||
|
|
||||||
proc setupEventHandlers(self: Controller) =
|
proc setupEventHandlers(self: Controller) =
|
||||||
self.eventsHandler.onGetCollectiblesDetailsDone(proc (jsonObj: JsonNode) =
|
self.eventsHandler.onGetCollectiblesDetailsDone(proc (jsonObj: JsonNode) =
|
||||||
self.processGetCollectiblesDetailsResponse(jsonObj)
|
self.processGetCollectiblesDetailsResponse(jsonObj)
|
||||||
|
|
|
@ -297,7 +297,12 @@ Item {
|
||||||
footer: WalletFooter {
|
footer: WalletFooter {
|
||||||
id: footer
|
id: footer
|
||||||
|
|
||||||
readonly property bool isHoldingSelected: !!walletStore.currentViewedCollectible && walletStore.currentViewedHoldingID !== ""
|
readonly property bool isHoldingSelected: {
|
||||||
|
if (!rightPanelStackView.currentItem || rightPanelStackView.currentItem.currentTabIndex !== WalletLayout.RightPanelSelection.Collectibles) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return !!walletStore.currentViewedCollectible && walletStore.currentViewedHoldingID !== ""
|
||||||
|
}
|
||||||
readonly property bool isCommunityCollectible: !!walletStore.currentViewedCollectible ? walletStore.currentViewedCollectible.communityId !== "" : false
|
readonly property bool isCommunityCollectible: !!walletStore.currentViewedCollectible ? walletStore.currentViewedCollectible.communityId !== "" : false
|
||||||
readonly property bool isOwnerCommunityCollectible: isCommunityCollectible ? (walletStore.currentViewedCollectible.communityPrivilegesLevel === Constants.TokenPrivilegesLevel.Owner) : false
|
readonly property bool isOwnerCommunityCollectible: isCommunityCollectible ? (walletStore.currentViewedCollectible.communityPrivilegesLevel === Constants.TokenPrivilegesLevel.Owner) : false
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,10 @@ QtObject {
|
||||||
walletSection.collectibleDetailsController.getDetailedCollectible(chainId, contractAddress, tokenId)
|
walletSection.collectibleDetailsController.getDetailedCollectible(chainId, contractAddress, tokenId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetDetailedCollectible() {
|
||||||
|
walletSection.collectibleDetailsController.resetDetailedCollectible()
|
||||||
|
}
|
||||||
|
|
||||||
function hasNFT(ownerAddress, chainId, tokenId, tokenAddress) {
|
function hasNFT(ownerAddress, chainId, tokenId, tokenAddress) {
|
||||||
const uid = getUidForData(tokenId, tokenAddress, chainId)
|
const uid = getUidForData(tokenId, tokenAddress, chainId)
|
||||||
ownerAddress = ownerAddress.toLowerCase()
|
ownerAddress = ownerAddress.toLowerCase()
|
||||||
|
|
|
@ -356,6 +356,7 @@ RightTabBaseView {
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
RootStore.resetCurrentViewedHolding(Constants.TokenType.ERC721)
|
RootStore.resetCurrentViewedHolding(Constants.TokenType.ERC721)
|
||||||
|
RootStore.collectiblesStore.resetDetailedCollectible()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue