From 216a1d1e2b94b0237dafa28790b91292fe138fb5 Mon Sep 17 00:00:00 2001 From: Michal Iskierko Date: Wed, 3 May 2023 15:19:33 +0200 Subject: [PATCH] fix(@desktop/communities): Deleting index when updating owners model and minor fixes Issue #10254 --- src/app/modules/main/communities/tokens/models/token_model.nim | 1 + src/app/modules/main/module.nim | 1 - src/app_service/service/community_tokens/service.nim | 2 +- ui/app/AppLayouts/Chat/panels/communities/TokenHoldersPanel.qml | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/modules/main/communities/tokens/models/token_model.nim b/src/app/modules/main/communities/tokens/models/token_model.nim index d4f4ab1ec46..3ab9a0c4202 100644 --- a/src/app/modules/main/communities/tokens/models/token_model.nim +++ b/src/app/modules/main/communities/tokens/models/token_model.nim @@ -54,6 +54,7 @@ QtObject: result = initTokenOwnersItem("", "", owner) )) let index = self.createIndex(i, 0, nil) + defer: index.delete self.dataChanged(index, index, @[ModelRole.TokenOwnersModel.int]) return diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index b2e3bb36abb..a553593d742 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -1221,4 +1221,3 @@ method activateStatusDeepLink*[T](self: Module[T], statusDeepLink: string) = method onDeactivateChatLoader*[T](self: Module[T], sectionId: string, chatId: string) = if (sectionId.len > 0 and self.channelGroupModules.contains(sectionId)): self.channelGroupModules[sectionId].onDeactivateChatLoader(chatId) - \ No newline at end of file diff --git a/src/app_service/service/community_tokens/service.nim b/src/app_service/service/community_tokens/service.nim index fe326951104..052811b83e1 100644 --- a/src/app_service/service/community_tokens/service.nim +++ b/src/app_service/service/community_tokens/service.nim @@ -270,7 +270,7 @@ QtObject: collectibleAndAmount.communityToken.chainId, ) except RpcException: - error "Error minting collectibles", message = getCurrentExceptionMsg() + error "Error airdropping collectibles", message = getCurrentExceptionMsg() proc getFiatValue*(self: Service, cryptoBalance: float, cryptoSymbol: string): float = if (cryptoSymbol == ""): diff --git a/ui/app/AppLayouts/Chat/panels/communities/TokenHoldersPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/TokenHoldersPanel.qml index 2ac741ab0e3..32a88d5af2d 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/TokenHoldersPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/TokenHoldersPanel.qml @@ -15,7 +15,7 @@ import shared.controls 1.0 Control { id: root - // Expected roles: name, walletAddress, imageSource, amount, selfDestructAmount and selfDestruct + // Expected roles: name, walletAddress, imageSource, amount property var model property string tokenName