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:
parent
2d0aaaa974
commit
2d21ff6c38
|
@ -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)
|
||||
|
|
|
@ -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) =
|
||||
|
|
|
@ -420,3 +420,5 @@ QtObject:
|
|||
QtProperty[bool] allTokenRequirementsMet:
|
||||
read = getAllTokenRequirementsMet
|
||||
notify = allTokenRequirementsMetChanged
|
||||
|
||||
proc userAuthenticationCanceled*(self: View) {.signal.}
|
|
@ -95,6 +95,14 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: communitySectionModule
|
||||
function onUserAuthenticationCanceled() {
|
||||
joinCommunityButton.invitationPending = false
|
||||
joinCommunityButton.loading = false
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: communityIntroDialog
|
||||
CommunityIntroDialog {
|
||||
|
|
Loading…
Reference in New Issue