fixes issue #1793 Confirmation popup when leaving room

This commit is contained in:
Arash Tabrizian
2018-03-30 17:53:11 +04:30
parent 2e3ecb7928
commit a48b963bbb
+35 -1
View File
@@ -591,7 +591,41 @@
- (IBAction)onLeaveButtonPressed:(id)sender
{
[self leaveEditedRoom];
__weak typeof(self) weakSelf = self;
// confirm leave
NSString *promptMessage = NSLocalizedStringFromTable(@"room_participants_leave_prompt_msg", @"Vector", nil);
currentAlert = [UIAlertController alertControllerWithTitle:NSLocalizedStringFromTable(@"room_participants_leave_prompt_title", @"Vector", nil)
message:promptMessage
preferredStyle:UIAlertControllerStyleAlert];
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
}
}]];
[currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"leave", @"Vector", nil)
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
[self leaveEditedRoom];
}
}]];
[currentAlert mxk_setAccessibilityIdentifier:@"RoomMemberDetailsVCKickAlert"];
[self presentViewController:currentAlert animated:YES completion:nil];
}
@end