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) =
|
proc setIsCurrentSectionActive*(self: Controller, active: bool) =
|
||||||
self.isCurrentSectionActive = active
|
self.isCurrentSectionActive = active
|
||||||
|
|
||||||
|
proc userAuthenticationCanceled*(self: Controller) =
|
||||||
|
self.tmpAuthenticationForJoinInProgress = false
|
||||||
|
self.tmpRequestToJoinEnsName = ""
|
||||||
|
self.tmpRequestToJoinAddressesToShare = @[]
|
||||||
|
|
||||||
proc requestToJoinCommunityAuthenticated*(self: Controller, password: string) =
|
proc requestToJoinCommunityAuthenticated*(self: Controller, password: string) =
|
||||||
self.communityService.asyncRequestToJoinCommunity(self.sectionId, self.tmpRequestToJoinEnsName,
|
self.communityService.asyncRequestToJoinCommunity(self.sectionId, self.tmpRequestToJoinEnsName,
|
||||||
password, self.tmpRequestToJoinAddressesToShare)
|
password, self.tmpRequestToJoinAddressesToShare)
|
||||||
|
|
|
@ -898,6 +898,11 @@ method onJoinedCommunity*(self: Module) =
|
||||||
self.view.setAmIMember(true)
|
self.view.setAmIMember(true)
|
||||||
|
|
||||||
method onUserAuthenticated*(self: Module, pin: string, password: string, keyUid: string) =
|
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)
|
self.controller.requestToJoinCommunityAuthenticated(password)
|
||||||
|
|
||||||
method onMarkAllMessagesRead*(self: Module, chat: ChatDto) =
|
method onMarkAllMessagesRead*(self: Module, chat: ChatDto) =
|
||||||
|
|
|
@ -420,3 +420,5 @@ QtObject:
|
||||||
QtProperty[bool] allTokenRequirementsMet:
|
QtProperty[bool] allTokenRequirementsMet:
|
||||||
read = getAllTokenRequirementsMet
|
read = getAllTokenRequirementsMet
|
||||||
notify = allTokenRequirementsMetChanged
|
notify = allTokenRequirementsMetChanged
|
||||||
|
|
||||||
|
proc userAuthenticationCanceled*(self: View) {.signal.}
|
|
@ -95,6 +95,14 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: communitySectionModule
|
||||||
|
function onUserAuthenticationCanceled() {
|
||||||
|
joinCommunityButton.invitationPending = false
|
||||||
|
joinCommunityButton.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
Component {
|
Component {
|
||||||
id: communityIntroDialog
|
id: communityIntroDialog
|
||||||
CommunityIntroDialog {
|
CommunityIntroDialog {
|
||||||
|
|
Loading…
Reference in New Issue