From 37e35d143eb278712d63979e877ce74fd4ac416d Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Fri, 20 Oct 2023 08:38:21 +0200 Subject: [PATCH] chore(@desktop/community): unused code removed --- .../modules/main/communities/controller.nim | 9 --------- .../modules/main/communities/io_interface.nim | 6 ------ src/app/modules/main/communities/module.nim | 4 ---- src/app/modules/main/communities/view.nim | 11 +++-------- ui/app/AppLayouts/Chat/stores/RootStore.qml | 18 ------------------ 5 files changed, 3 insertions(+), 45 deletions(-) diff --git a/src/app/modules/main/communities/controller.nim b/src/app/modules/main/communities/controller.nim index bd7ca52c76..cbb02ef132 100644 --- a/src/app/modules/main/communities/controller.nim +++ b/src/app/modules/main/communities/controller.nim @@ -39,7 +39,6 @@ type tmpRequestToJoinEnsName: string tmpAddressesToShare: seq[string] tmpAirdropAddress: string - tmpAuthenticationWithCallbackInProgress: bool proc newController*( delegate: io_interface.AccessInterface, @@ -66,7 +65,6 @@ proc newController*( result.tmpRequestToJoinEnsName = "" result.tmpAirdropAddress = "" result.tmpAddressesToShare = @[] - result.tmpAuthenticationWithCallbackInProgress = false proc delete*(self: Controller) = discard @@ -204,10 +202,6 @@ proc init*(self: Controller) = if args.uniqueIdentifier != UNIQUE_COMMUNITIES_MODULE_AUTH_IDENTIFIER: return self.delegate.onUserAuthenticated(args.pin, args.password, args.keyUid) - if self.tmpAuthenticationWithCallbackInProgress: - let authenticated = not (args.password == "" and args.pin == "") - self.delegate.callbackFromAuthentication(authenticated) - self.tmpAuthenticationWithCallbackInProgress = false self.events.on(SIGNAL_CHECK_PERMISSIONS_TO_JOIN_FAILED) do(e: Args): let args = CheckPermissionsToJoinFailedArgs(e) @@ -429,9 +423,6 @@ proc authenticateToEditSharedAddresses*(self: Controller, communityId: string, a self.tmpAddressesToShare = addressesToShare self.authenticate() -proc authenticateWithCallback*(self: Controller) = - self.tmpAuthenticationWithCallbackInProgress = true - self.authenticate() proc getCommunityPublicKeyFromPrivateKey*(self: Controller, communityPrivateKey: string): string = result = self.communityService.getCommunityPublicKeyFromPrivateKey(communityPrivateKey) diff --git a/src/app/modules/main/communities/io_interface.nim b/src/app/modules/main/communities/io_interface.nim index b3859bf0c6..6d2182d5e0 100644 --- a/src/app/modules/main/communities/io_interface.nim +++ b/src/app/modules/main/communities/io_interface.nim @@ -191,12 +191,6 @@ method editSharedAddressesWithAuthentication*(self: AccessInterface, communityId {.base.} = raise newException(ValueError, "No implementation available") -method authenticateWithCallback*(self: AccessInterface) {.base.} = - raise newException(ValueError, "No implementation available") - -method callbackFromAuthentication*(self: AccessInterface, authenticated: bool) {.base.} = - raise newException(ValueError, "No implementation available") - method prepareTokenModelForCommunity*(self: AccessInterface, communityId: string) {.base.} = raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/communities/module.nim b/src/app/modules/main/communities/module.nim index 0798f69c6f..84a7e9cd2a 100644 --- a/src/app/modules/main/communities/module.nim +++ b/src/app/modules/main/communities/module.nim @@ -549,11 +549,7 @@ method requestToJoinCommunityWithAuthentication*(self: Module, communityId, ensN method editSharedAddressesWithAuthentication*(self: Module, communityId: string, addressesToShare: seq[string], airdropAddress: string) = self.controller.authenticateToEditSharedAddresses(communityId, addressesToShare, airdropAddress) -method authenticateWithCallback*(self: Module) = - self.controller.authenticateWithCallback() -method callbackFromAuthentication*(self: Module, authenticated: bool) = - self.view.callbackFromAuthentication(authenticated) method getCommunityPublicKeyFromPrivateKey*(self: Module, communityPrivateKey: string): string = result = self.controller.getCommunityPublicKeyFromPrivateKey(communityPrivateKey) diff --git a/src/app/modules/main/communities/view.nim b/src/app/modules/main/communities/view.nim index 92e092b2ef..eb9562493b 100644 --- a/src/app/modules/main/communities/view.nim +++ b/src/app/modules/main/communities/view.nim @@ -127,7 +127,7 @@ QtObject: proc communityInfoAlreadyRequested*(self: View) {.signal.} proc communityTagsChanged*(self: View) {.signal.} - + proc setCommunityTags*(self: View, communityTags: string) = self.communityTags = newQVariant(communityTags) self.communityTagsChanged() @@ -285,7 +285,7 @@ QtObject: proc addItem*(self: View, item: SectionItem) = self.model.addItem(item) self.communityAdded(item.id) - + proc updateItem(self: View, item: SectionItem) = self.model.editItem(item) self.communityChanged(item.id) @@ -295,7 +295,7 @@ QtObject: self.updateItem(item) else: self.addItem(item) - + proc model*(self: View): SectionModel = result = self.model @@ -675,11 +675,6 @@ QtObject: proc userAuthenticationCanceled*(self: View) {.signal.} - proc authenticateWithCallback*(self: View) {.slot.} = - self.delegate.authenticateWithCallback() - - proc callbackFromAuthentication*(self: View, authenticated: bool) {.signal.} - proc requestToJoinCommunityWithAuthentication*(self: View, communityId: string, ensName: string) {.slot.} = self.delegate.requestToJoinCommunityWithAuthentication(communityId, ensName, @[], "") diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index afc2c8f688..b60f96fb7d 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -557,11 +557,6 @@ QtObject { return Constants.LoginType.Password } - function authenticateWithCallback(callback) { - _d.authenticationCallbacks.push(callback) - communitiesModuleInst.authenticateWithCallback() - } - readonly property Connections communitiesModuleConnections: Connections { target: communitiesModuleInst function onImportingCommunityStateChanged(communityId, state, errorMsg) { @@ -593,19 +588,6 @@ QtObject { } readonly property QtObject _d: QtObject { - property var authenticationCallbacks: [] - - readonly property Connections chatCommunitySectionModuleConnections: Connections { - target: communitiesModuleInst - function onCallbackFromAuthentication(authenticated: bool) { - _d.authenticationCallbacks.forEach((callback) => { - if(!!callback) - callback(authenticated) - }) - _d.authenticationCallbacks = [] - } - } - readonly property var sectionDetailsInstantiator: Instantiator { model: SortFilterProxyModel { sourceModel: mainModuleInst.sectionsModel