Skip to content

Commit d60e5da

Browse files
authored
refactor: platform specific logic from view common
1 parent be6e408 commit d60e5da

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

tns-core-modules/ui/core/view/view-common.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
350350
}
351351
}
352352

353-
if (isAndroid || (parent.viewController && parent.viewController.presentedViewController)) {
354-
that._hideNativeModalView(parent, whenClosedCallback);
355-
} else {
356-
whenClosedCallback();
357-
}
353+
that._hideNativeModalView(parent, whenClosedCallback);
358354
}
359355
};
360356
}

tns-core-modules/ui/core/view/view.ios.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,12 @@ export class View extends ViewCommon {
452452
return;
453453
}
454454

455+
// modal view has already been closed by UI, probably as a popover
456+
if (!parent.viewController.presentedViewController) {
457+
whenClosedCallback();
458+
return;
459+
}
460+
455461
const parentController = parent.viewController;
456462
const animated = (<any>this.viewController).animated;
457463

0 commit comments

Comments
 (0)