mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
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}
|
traits:{self.traits}
|
||||||
)"""
|
)"""
|
||||||
|
|
||||||
proc getCollectiblUniqueID*(self: CollectiblesEntry): backend.CollectibleUniqueID =
|
proc getCollectibleUniqueID*(self: CollectiblesEntry): backend.CollectibleUniqueID =
|
||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
proc hasCollectibleData(self: CollectiblesEntry): bool =
|
proc hasCollectibleData(self: CollectiblesEntry): bool =
|
||||||
@ -122,9 +122,10 @@ QtObject:
|
|||||||
|
|
||||||
proc nameChanged*(self: CollectiblesEntry) {.signal.}
|
proc nameChanged*(self: CollectiblesEntry) {.signal.}
|
||||||
proc getName*(self: CollectiblesEntry): string {.slot.} =
|
proc getName*(self: CollectiblesEntry): string {.slot.} =
|
||||||
if not self.hasCollectibleData():
|
if self.hasCollectibleData():
|
||||||
return ""
|
result = self.data.collectibleData.get().name
|
||||||
return self.data.collectibleData.get().name
|
if result == "":
|
||||||
|
result = "#" & self.getTokenIDAsString()
|
||||||
|
|
||||||
QtProperty[string] name:
|
QtProperty[string] name:
|
||||||
read = getName
|
read = getName
|
||||||
@ -205,9 +206,10 @@ QtObject:
|
|||||||
|
|
||||||
proc collectionNameChanged*(self: CollectiblesEntry) {.signal.}
|
proc collectionNameChanged*(self: CollectiblesEntry) {.signal.}
|
||||||
proc getCollectionName*(self: CollectiblesEntry): string {.slot.} =
|
proc getCollectionName*(self: CollectiblesEntry): string {.slot.} =
|
||||||
if not self.hasCollectionData():
|
if self.hasCollectionData():
|
||||||
return ""
|
result = self.getCollectionData().name
|
||||||
return self.getCollectionData().name
|
if result == "":
|
||||||
|
result = self.getContractAddress()
|
||||||
|
|
||||||
QtProperty[string] collectionName:
|
QtProperty[string] collectionName:
|
||||||
read = getCollectionName
|
read = getCollectionName
|
||||||
@ -244,9 +246,10 @@ QtObject:
|
|||||||
|
|
||||||
proc communityNameChanged*(self: CollectiblesEntry) {.signal.}
|
proc communityNameChanged*(self: CollectiblesEntry) {.signal.}
|
||||||
proc getCommunityName*(self: CollectiblesEntry): string {.slot.} =
|
proc getCommunityName*(self: CollectiblesEntry): string {.slot.} =
|
||||||
if not self.hasCommunityData():
|
if self.hasCommunityData():
|
||||||
return ""
|
result = self.getCommunityData().name
|
||||||
return self.getCommunityData().name
|
if result == "":
|
||||||
|
result = self.getCommunityID()
|
||||||
|
|
||||||
QtProperty[string] communityName:
|
QtProperty[string] communityName:
|
||||||
read = getCommunityName
|
read = getCommunityName
|
||||||
|
@ -340,7 +340,7 @@ QtObject:
|
|||||||
let entry = self.items[i]
|
let entry = self.items[i]
|
||||||
for j in countdown(updates.high, 0):
|
for j in countdown(updates.high, 0):
|
||||||
let update = updates[j]
|
let update = updates[j]
|
||||||
if entry.getCollectiblUniqueID() == update.id:
|
if entry.getCollectibleUniqueID() == update.id:
|
||||||
entry.updateData(update)
|
entry.updateData(update)
|
||||||
let index = self.createIndex(i, 0, nil)
|
let index = self.createIndex(i, 0, nil)
|
||||||
defer: index.delete
|
defer: index.delete
|
||||||
|
Loading…
x
Reference in New Issue
Block a user