Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash de l'application quand on quitte un salon dont on est le dernie… #932

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Riot/Modules/Common/Recents/RecentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ - (void)leaveEditedRoom

}]];

// Tchap: handle last admin alert
[room tc_isCurrentUserLastAdministrator:^(BOOL isLastAdmin) {
[self stopActivityIndicator];

Expand All @@ -1435,11 +1436,11 @@ - (void)leaveEditedRoom
}

MXWeakify(self);
self->currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomParticipantsLeavePromptTitle]
UIAlertController *lastAdminAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomParticipantsLeavePromptTitle]
message:promptMessage
preferredStyle:UIAlertControllerStyleAlert];

[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
[lastAdminAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {

Expand All @@ -1448,7 +1449,7 @@ - (void)leaveEditedRoom

}]];

[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
[lastAdminAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

MXStrongifyAndReturnIfNil(self);
Expand Down Expand Up @@ -1502,8 +1503,9 @@ - (void)leaveEditedRoom

}]];

[self->currentAlert mxk_setAccessibilityIdentifier:@"LeaveEditedRoomAlert"];
[self presentViewController:self->currentAlert animated:YES completion:nil];
[lastAdminAlert mxk_setAccessibilityIdentifier:@"LeaveEditedRoomAlert"];
[self presentViewController:lastAdminAlert animated:YES completion:nil];
self->currentAlert = lastAdminAlert;
}];
}
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/931.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Crash de l'application quand on quitte un salon dont on est le dernier administrateur depuis le menu d'actions rapides
Loading