Skip to content

Commit

Permalink
fix(ios): don't ignore close call immediately after open on Window
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Jun 22, 2020
1 parent 522c035 commit 07502db
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ - (void)setStatusBarStyle:(id)style

- (void)close:(id)args
{
//I am not open. Go Away
if (opening) {
DebugLog(@"Window is opening. Ignoring this close call");
return;
}

if (!opened) {
// If I've been asked to open but haven't yet, short-circuit it and tell it not to open
if (opening) {
opening = NO; // _handleOpen: should check this and abort opening
DebugLog(@"Window is not open yet. Attempting to stop it from opening...");
return;
}

DebugLog(@"Window is not open. Ignoring this close call");
return;
}
Expand Down Expand Up @@ -361,6 +362,11 @@ - (BOOL)_handleOpen:(id)args
RELEASE_TO_NIL(openAnimation);
}

// Did someone try to close before we ever finished opening?
if (!opening) {
return NO;
}

return YES;
}

Expand Down

0 comments on commit 07502db

Please sign in to comment.