Skip to content

Commit

Permalink
fix(android): navigationWindow open/close event
Browse files Browse the repository at this point in the history
Fixes TIMOB-27834
  • Loading branch information
m1ga authored and sgtcoolguy committed Jun 3, 2020
1 parent 08227a9 commit ec1976a
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ public NavigationWindowProxy()
public void open(@Kroll.argument(optional = true) Object arg)
{
// FIXME: Shouldn't this complain/blow up if window isn't specified?
if (getProperties().containsKeyAndNotNull(TiC.PROPERTY_WINDOW)) {
if (!opened && getProperties().containsKeyAndNotNull(TiC.PROPERTY_WINDOW)) {
opened = true;
Object rootView = getProperties().get(TiC.PROPERTY_WINDOW);
if (rootView instanceof WindowProxy || rootView instanceof TabGroupProxy) {
openWindow(rootView, arg);
fireEvent(TiC.EVENT_OPEN, null);
}
return;
}
Expand All @@ -56,8 +57,12 @@ public void popToRootWindow(@Kroll.argument(optional = true) Object arg)
@Kroll.method
public void close(@Kroll.argument(optional = true) Object arg)
{
popToRootWindow(arg);
closeWindow(windows.get(0), arg); // close the root window
if (opened) {
opened = false;
popToRootWindow(arg);
closeWindow(windows.get(0), arg); // close the root window
fireEvent(TiC.EVENT_CLOSE, null);
}
super.close(arg);
}

Expand Down

0 comments on commit ec1976a

Please sign in to comment.