Skip to content

Commit

Permalink
fix(modal): throw from tns-core-modules is now properly caught and re…
Browse files Browse the repository at this point in the history
…jected
  • Loading branch information
NathanWalker authored and Alexander Vakrilov committed Jun 27, 2018
1 parent dc8080b commit 70730d9
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions nativescript-angular/directives/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,25 @@ export class ModalDialogService {

this.location._beginModalNavigation();

return new Promise(resolve => {
setTimeout(() => this._showDialog({
containerRef: viewContainerRef,
context,
doneCallback: resolve,
fullscreen,
animated,
stretched,
pageFactory,
parentView,
resolver,
type,
}), 10);
return new Promise((resolve, reject) => {
setTimeout(() => {
try {
this._showDialog({
containerRef: viewContainerRef,
context,
doneCallback: resolve,
fullscreen,
animated,
stretched,
pageFactory,
parentView,
resolver,
type,
});
} catch (err) {
reject(err);
}
}, 10);
});
}

Expand Down

0 comments on commit 70730d9

Please sign in to comment.