Skip to content

Commit

Permalink
Make sure to show onboarding login view after deleting an account
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Sep 4, 2024
1 parent fa8dec1 commit a470103
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Monal/Classes/XMPPEdit.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#import "MLSwitchCell.h"
#import "MLOMEMO.h"
#import "MLNotificationQueue.h"
#import "MonalAppDelegate.h"
#import "ActiveChatsViewController.h"
#import "Monal-Swift.h"

@import MobileCoreServices;
Expand Down Expand Up @@ -467,7 +469,14 @@ - (IBAction) removeAccountClicked: (id) sender
[hud hideAnimated:YES afterDelay:1.0f];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:^{
//we want to start fresh instead of doing a "password migration"-restore directly triggering an sms
[[HelperTools defaultsDB] removeObjectForKey:@"Quicksy_phoneNumber"];
[[HelperTools defaultsDB] removeObjectForKey:@"Quicksy_country"];
//make sure we show account creation view etc. after removing the last account
MonalAppDelegate* appDelegate = (MonalAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.activeChats segueToIntroScreensIfNeeded];
}];
});
}];
[questionAlert addAction:noAction];
Expand Down Expand Up @@ -523,7 +532,14 @@ -(IBAction) deleteAccountClicked:(id) sender
[hud hideAnimated:YES afterDelay:1.0f];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:^{
//we want to start fresh instead of doing a "password migration"-restore directly triggering an sms
[[HelperTools defaultsDB] removeObjectForKey:@"Quicksy_phoneNumber"];
[[HelperTools defaultsDB] removeObjectForKey:@"Quicksy_country"];
//make sure we show account creation view etc. after removing the last account
MonalAppDelegate* appDelegate = (MonalAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.activeChats segueToIntroScreensIfNeeded];
}];
});
}
});
Expand Down

0 comments on commit a470103

Please sign in to comment.