chore(@desktop/community): unused code removed

This commit is contained in:
Sale Djenic 2023-10-20 08:38:21 +02:00 committed by saledjenic
parent 81fd27526e
commit 37e35d143e
5 changed files with 3 additions and 45 deletions

View File

@ -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)

View File

@ -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")

View File

@ -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)

View File

@ -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, @[], "")

View File

@ -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