mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix: Crash in when livesync-ing minimized app
This commit is contained in:
@@ -4,6 +4,7 @@ import frame = require("ui/frame");
|
||||
import types = require("utils/types");
|
||||
import observable = require("data/observable");
|
||||
import enums = require("ui/enums");
|
||||
import fileResolverModule = require("file-system/file-name-resolver");
|
||||
|
||||
global.moduleMerge(appModule, exports);
|
||||
|
||||
@@ -71,6 +72,8 @@ var initEvents = function () {
|
||||
return;
|
||||
}
|
||||
|
||||
(<any>androidApp).paused = true;
|
||||
|
||||
if (activity === androidApp.foregroundActivity) {
|
||||
if (exports.onSuspend) {
|
||||
exports.onSuspend();
|
||||
@@ -91,6 +94,8 @@ var initEvents = function () {
|
||||
return;
|
||||
}
|
||||
|
||||
(<any>androidApp).paused = false;
|
||||
|
||||
if (activity === androidApp.foregroundActivity) {
|
||||
if (exports.onResume) {
|
||||
exports.onResume();
|
||||
@@ -347,3 +352,18 @@ function onConfigurationChanged(context: android.content.Context, intent: androi
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
global.__onLiveSync = function () {
|
||||
if (exports.android && exports.android.paused) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear file resolver cache to respect newly added files.
|
||||
fileResolverModule.clearCache();
|
||||
|
||||
// Reload app.css in case it was changed.
|
||||
appModule.loadCss();
|
||||
|
||||
// Reload current page.
|
||||
frame.reloadPage();
|
||||
}
|
||||
Reference in New Issue
Block a user