fix(@desktop/wallet): Handle collectibles with missing metadata in lists
Fixes #13162
This commit is contained in:
parent
415d0f3594
commit
bfeee36042
|
@ -70,7 +70,7 @@ QtObject:
|
|||
traits:{self.traits}
|
||||
)"""
|
||||
|
||||
proc getCollectiblUniqueID*(self: CollectiblesEntry): backend.CollectibleUniqueID =
|
||||
proc getCollectibleUniqueID*(self: CollectiblesEntry): backend.CollectibleUniqueID =
|
||||
return self.id
|
||||
|
||||
proc hasCollectibleData(self: CollectiblesEntry): bool =
|
||||
|
@ -122,9 +122,10 @@ QtObject:
|
|||
|
||||
proc nameChanged*(self: CollectiblesEntry) {.signal.}
|
||||
proc getName*(self: CollectiblesEntry): string {.slot.} =
|
||||
if not self.hasCollectibleData():
|
||||
return ""
|
||||
return self.data.collectibleData.get().name
|
||||
if self.hasCollectibleData():
|
||||
result = self.data.collectibleData.get().name
|
||||
if result == "":
|
||||
result = "#" & self.getTokenIDAsString()
|
||||
|
||||
QtProperty[string] name:
|
||||
read = getName
|
||||
|
@ -205,9 +206,10 @@ QtObject:
|
|||
|
||||
proc collectionNameChanged*(self: CollectiblesEntry) {.signal.}
|
||||
proc getCollectionName*(self: CollectiblesEntry): string {.slot.} =
|
||||
if not self.hasCollectionData():
|
||||
return ""
|
||||
return self.getCollectionData().name
|
||||
if self.hasCollectionData():
|
||||
result = self.getCollectionData().name
|
||||
if result == "":
|
||||
result = self.getContractAddress()
|
||||
|
||||
QtProperty[string] collectionName:
|
||||
read = getCollectionName
|
||||
|
@ -244,9 +246,10 @@ QtObject:
|
|||
|
||||
proc communityNameChanged*(self: CollectiblesEntry) {.signal.}
|
||||
proc getCommunityName*(self: CollectiblesEntry): string {.slot.} =
|
||||
if not self.hasCommunityData():
|
||||
return ""
|
||||
return self.getCommunityData().name
|
||||
if self.hasCommunityData():
|
||||
result = self.getCommunityData().name
|
||||
if result == "":
|
||||
result = self.getCommunityID()
|
||||
|
||||
QtProperty[string] communityName:
|
||||
read = getCommunityName
|
||||
|
|
|
@ -340,7 +340,7 @@ QtObject:
|
|||
let entry = self.items[i]
|
||||
for j in countdown(updates.high, 0):
|
||||
let update = updates[j]
|
||||
if entry.getCollectiblUniqueID() == update.id:
|
||||
if entry.getCollectibleUniqueID() == update.id:
|
||||
entry.updateData(update)
|
||||
let index = self.createIndex(i, 0, nil)
|
||||
defer: index.delete
|
||||
|
|
Loading…
Reference in New Issue