Skip to content

Commit

Permalink
Fix unsolicited settings close
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Oct 20, 2024
1 parent e36fe00 commit b4d8fa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion Monal/Classes/ActiveChatsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) IBOutlet UIBarButtonItem* settingsButton;
@property (weak, nonatomic) IBOutlet UIBarButtonItem* spinnerButton;
@property (nonatomic, weak) IBOutlet UIBarButtonItem* composeButton;
@property (nonatomic, strong) chatViewController* currentChatViewController;
@property (nonatomic, strong) UIActivityIndicatorView* spinner;
@property (atomic, strong) SizeClassWrapper* sizeClass;

Expand Down
6 changes: 3 additions & 3 deletions Monal/Classes/ActiveChatsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,13 @@ -(void) refreshDisplay

dispatch_async(dispatch_get_main_queue(), ^{
//make sure we don't display a chat view for a disabled account
if(self.currentChatViewController != nil && self.currentChatViewController.contact != nil)
if([MLNotificationManager sharedInstance].currentContact != nil)
{
BOOL found = NO;
for(NSDictionary* accountDict in [[DataLayer sharedInstance] enabledAccountList])
{
NSNumber* accountID = accountDict[kAccountID];
if(self.currentChatViewController.contact.accountID.intValue == accountID.intValue)
if([MLNotificationManager sharedInstance].currentContact.accountID.intValue == accountID.intValue)
found = YES;
}
if(!found)
Expand Down Expand Up @@ -899,6 +899,7 @@ -(void) presentSplitPlaceholder
UIViewController* detailsViewController = [[SwiftuiInterface new] makeViewWithName:@"ChatPlaceholder"];
[self showDetailViewController:detailsViewController sender:self];
}
[MLNotificationManager sharedInstance].currentContact = nil;
}

-(void) showNotificationSettings
Expand Down Expand Up @@ -1109,7 +1110,6 @@ -(void) prepareForSegue:(UIStoryboardSegue*) segue sender:(id) sender
UIBarButtonItem* barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
self.navigationItem.backBarButtonItem = barButtonItem;
[chatVC setupWithContact:sender];
self.currentChatViewController = chatVC;
}
else if([segue.identifier isEqualToString:@"showDetails"])
{
Expand Down

0 comments on commit b4d8fa2

Please sign in to comment.