fix(community): fix cancel of authentication still requests to join

Fixes #11272

The problem was that we didn't handle the cancelation (checking with password was empty). 

Now we do and we send the signal to cancel when it's the case.
This commit is contained in:
Jonathan Rainville 2023-06-28 14:27:47 -04:00
parent 2d0aaaa974
commit 2d21ff6c38
4 changed files with 20 additions and 0 deletions

View File

@ -91,6 +91,11 @@ proc getIsCurrentSectionActive*(self: Controller): bool =
proc setIsCurrentSectionActive*(self: Controller, active: bool) =
self.isCurrentSectionActive = active
proc userAuthenticationCanceled*(self: Controller) =
self.tmpAuthenticationForJoinInProgress = false
self.tmpRequestToJoinEnsName = ""
self.tmpRequestToJoinAddressesToShare = @[]
proc requestToJoinCommunityAuthenticated*(self: Controller, password: string) =
self.communityService.asyncRequestToJoinCommunity(self.sectionId, self.tmpRequestToJoinEnsName,
password, self.tmpRequestToJoinAddressesToShare)

View File

@ -898,6 +898,11 @@ method onJoinedCommunity*(self: Module) =
self.view.setAmIMember(true)
method onUserAuthenticated*(self: Module, pin: string, password: string, keyUid: string) =
if password == "" and pin == "":
self.view.userAuthenticationCanceled()
self.controller.userAuthenticationCanceled()
return
self.controller.requestToJoinCommunityAuthenticated(password)
method onMarkAllMessagesRead*(self: Module, chat: ChatDto) =

View File

@ -420,3 +420,5 @@ QtObject:
QtProperty[bool] allTokenRequirementsMet:
read = getAllTokenRequirementsMet
notify = allTokenRequirementsMetChanged
proc userAuthenticationCanceled*(self: View) {.signal.}

View File

@ -95,6 +95,14 @@ Item {
}
}
}
Connections {
target: communitySectionModule
function onUserAuthenticationCanceled() {
joinCommunityButton.invitationPending = false
joinCommunityButton.loading = false
}
}
Component {
id: communityIntroDialog
CommunityIntroDialog {