fix(community_tokens): ignore wallet events from watch only accounts

Fixes #13407
This commit is contained in:
Jonathan Rainville 2024-02-26 16:35:06 -05:00
parent b623c8fb2b
commit 5b8f37cba2
1 changed files with 11 additions and 0 deletions

View File

@ -334,6 +334,12 @@ QtObject:
try:
let dataMessageJson = parseJson(jsonMessage)
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:
if not coll.communityData.isSome():
continue
@ -406,6 +412,11 @@ QtObject:
if len(tokenDataPayload.communityId) == 0:
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
if len(accounts) > 0:
accountAddress = accounts[0]