fix(community_tokens): ignore wallet events from watch only accounts
Fixes #13407
This commit is contained in:
parent
b623c8fb2b
commit
5b8f37cba2
|
@ -334,6 +334,12 @@ QtObject:
|
||||||
try:
|
try:
|
||||||
let dataMessageJson = parseJson(jsonMessage)
|
let dataMessageJson = parseJson(jsonMessage)
|
||||||
let tokenDataPayload = fromJson(dataMessageJson, CommunityCollectiblesReceivedPayload)
|
let tokenDataPayload = fromJson(dataMessageJson, CommunityCollectiblesReceivedPayload)
|
||||||
|
|
||||||
|
let watchOnlyAccounts = self.walletAccountService.getWatchOnlyAccounts()
|
||||||
|
if any(watchOnlyAccounts, proc (x: WalletAccountDto): bool = x.address == accounts[0]):
|
||||||
|
# skip events on watch-only accounts
|
||||||
|
return
|
||||||
|
|
||||||
for coll in tokenDataPayload.collectibles:
|
for coll in tokenDataPayload.collectibles:
|
||||||
if not coll.communityData.isSome():
|
if not coll.communityData.isSome():
|
||||||
continue
|
continue
|
||||||
|
@ -406,6 +412,11 @@ QtObject:
|
||||||
if len(tokenDataPayload.communityId) == 0:
|
if len(tokenDataPayload.communityId) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
let watchOnlyAccounts = self.walletAccountService.getWatchOnlyAccounts()
|
||||||
|
if any(watchOnlyAccounts, proc (x: WalletAccountDto): bool = x.address == accounts[0]):
|
||||||
|
# skip events on watch-only accounts
|
||||||
|
return
|
||||||
|
|
||||||
var accountName, accountAddress: string
|
var accountName, accountAddress: string
|
||||||
if len(accounts) > 0:
|
if len(accounts) > 0:
|
||||||
accountAddress = accounts[0]
|
accountAddress = accounts[0]
|
||||||
|
|
Loading…
Reference in New Issue