Skip to content

Commit 73d83ed

Browse files
author
Vladimir Amiorkov
authored
fix(hmr): close modal views during livesync #7669 (#1944)
* fix(hmr): close modal views during livesync #7669 * chore: change 'tests-app-ng' app to symlink source
1 parent 3c7b828 commit 73d83ed

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

Diff for: e2e/tests-app-ng/package.json

+12-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@
44
"readme": "NativeScript Application",
55
"repository": "<fill-your-repository-here>",
66
"nativescript": {
7-
"id": "org.nativescript.testsappng"
7+
"id": "org.nativescript.testsappng",
8+
"tns-ios": {
9+
"version": "6.0.2"
10+
},
11+
"tns-android": {
12+
"version": "6.0.2"
13+
}
814
},
915
"dependencies": {
16+
"@angular/animations": "~8.2.0",
1017
"@angular/common": "~8.2.0",
1118
"@angular/compiler": "~8.2.0",
1219
"@angular/core": "~8.2.0",
1320
"@angular/forms": "~8.2.0",
1421
"@angular/platform-browser": "~8.2.0",
1522
"@angular/platform-browser-dynamic": "~8.2.0",
1623
"@angular/router": "~8.2.0",
17-
"nativescript-angular": "next",
24+
"nativescript-angular": "file:../../nativescript-angular",
1825
"nativescript-intl": "~3.0.0",
1926
"nativescript-theme-core": "^1.0.4",
2027
"reflect-metadata": "~0.1.8",
@@ -23,6 +30,8 @@
2330
"zone.js": "^0.9.1"
2431
},
2532
"devDependencies": {
33+
"@angular/compiler-cli": "~8.2.0",
34+
"@ngtools/webpack": "~8.2.0",
2635
"babel-traverse": "6.24.1",
2736
"babel-types": "6.24.1",
2837
"babylon": "6.17.0",
@@ -31,9 +40,7 @@
3140
"lazy": "1.0.11",
3241
"nativescript-dev-webpack": "next",
3342
"tslint": "^5.4.3",
34-
"typescript": "~3.5.3",
35-
"@angular/compiler-cli": "~8.0.0",
36-
"@ngtools/webpack": "~8.0.0"
43+
"typescript": "~3.5.3"
3744
},
3845
"scripts": {
3946
"tslint": "tslint --config tslint.json 'app/**/*.ts'"

Diff for: e2e/tests-app-ng/tsconfig.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@
2222
]
2323
}
2424
},
25+
"include": [
26+
"../../nativescript-angular",
27+
"**/*"
28+
],
2529
"exclude": [
30+
"../../nativescript-angular/node_modules",
31+
"../../nativescript-angular/**/*.d.ts",
2632
"node_modules",
27-
"platforms"
33+
"platforms",
34+
"**/*.aot",
35+
"e2e"
2836
]
2937
}

Diff for: nativescript-angular/platform-common.ts

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "./zone-js/dist/zone-nativescript";
66
import "./polyfills/array";
77
import "./polyfills/console";
88
import { profile, uptime } from "tns-core-modules/profiling";
9+
import { getRootView } from "tns-core-modules/application";
910
import "./dom-adapter";
1011

1112
import {
@@ -153,6 +154,11 @@ export class NativeScriptPlatformRef extends PlatformRef {
153154
private bootstrapApp() {
154155
(<any>global).__onLiveSyncCore = () => {
155156
if (this.appOptions.hmrOptions) {
157+
const rootView = getRootView();
158+
if (rootView) {
159+
rootView._closeAllModalViewsInternal();
160+
}
161+
156162
this.appOptions.hmrOptions.livesyncCallback(() => this._livesync());
157163
} else {
158164
this._livesync();

0 commit comments

Comments
 (0)