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 {
3434 launchEvent ,
3535 LaunchEventData ,
3636 exitEvent ,
37+ ApplicationEventData ,
3738} from "tns-core-modules/application" ;
3839import { TextView } from "tns-core-modules/ui/text-view" ;
3940
@@ -257,9 +258,16 @@ export class NativeScriptPlatformRef extends PlatformRef {
257258 }
258259 ) ;
259260 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+
261268 const lastModuleRef = lastBootstrappedModule ? lastBootstrappedModule . get ( ) : null ;
262269 if ( lastModuleRef ) {
270+ // Make sure the module is only destroyed once
263271 lastBootstrappedModule = null ;
264272
265273 lastModuleRef . destroy ( ) ;
You can’t perform that action at this time.
0 commit comments