File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import {
34
34
launchEvent ,
35
35
LaunchEventData ,
36
36
exitEvent ,
37
+ ApplicationEventData ,
37
38
} from "tns-core-modules/application" ;
38
39
import { TextView } from "tns-core-modules/ui/text-view" ;
39
40
@@ -257,9 +258,16 @@ export class NativeScriptPlatformRef extends PlatformRef {
257
258
}
258
259
) ;
259
260
const exitCallback = profile (
260
- "nativescript-angular/platform-common.exitCallback" , ( ) => {
261
+ "nativescript-angular/platform-common.exitCallback" , ( args : ApplicationEventData ) => {
262
+ const androidActivity = args . android ;
263
+ if ( androidActivity && ! androidActivity . isFinishing ( ) ) {
264
+ // Exit event was triggered as a part of a restart of the app.
265
+ return ;
266
+ }
267
+
261
268
const lastModuleRef = lastBootstrappedModule ? lastBootstrappedModule . get ( ) : null ;
262
269
if ( lastModuleRef ) {
270
+ // Make sure the module is only destroyed once
263
271
lastBootstrappedModule = null ;
264
272
265
273
lastModuleRef . destroy ( ) ;
You can’t perform that action at this time.
0 commit comments