Skip to content

Commit

Permalink
move displayDialog outside of synchronized blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
emawby committed Apr 29, 2024
1 parent a1a66bf commit 790b776
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions iOS_SDK/OneSignalSDK/Source/OneSignalDialogController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ - (void)presentDialogWithTitle:(NSString * _Nonnull)title withMessage:(NSString
//if so, we shouldn't present on top of existing dialog
if (self.queue.count > 1)
return;

[self displayDialog:request];
}
[self displayDialog:request];
});
}

Expand Down Expand Up @@ -102,6 +101,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto

- (void)delayResult:(int)result {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
OSDialogRequest *nextDialog = nil;
@synchronized (self.queue) {
if (self.queue.count > 0) {
let currentDialog = self.queue.firstObject;
Expand All @@ -116,8 +116,9 @@ - (void)delayResult:(int)result {
if (self.queue.count == 0)
return;

let nextDialog = self.queue.firstObject;

nextDialog = self.queue.firstObject;
}
if (nextDialog != nil) {
[self displayDialog:nextDialog];
}
});
Expand Down

0 comments on commit 790b776

Please sign in to comment.