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,7 +4,6 @@ import fs = require("file-system");
|
||||
import styleScope = require("ui/styling/style-scope");
|
||||
import observable = require("data/observable");
|
||||
import frame = require("ui/frame");
|
||||
import fileResolverModule = require("file-system/file-name-resolver");
|
||||
|
||||
var events = new observable.Observable();
|
||||
global.moduleMerge(events, exports);
|
||||
@@ -51,15 +50,4 @@ export function loadCss() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
global.__onLiveSync = function () {
|
||||
// Clear file resolver cache to respect newly added files.
|
||||
fileResolverModule.clearCache();
|
||||
|
||||
// Reload app.css in case it was changed.
|
||||
loadCss();
|
||||
|
||||
// Reload current page.
|
||||
frame.reloadPage();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import view = require("ui/core/view");
|
||||
import definition = require("application");
|
||||
import enums = require("ui/enums");
|
||||
import uiUtils = require("ui/utils");
|
||||
import fileResolverModule = require("file-system/file-name-resolver");
|
||||
|
||||
global.moduleMerge(appModule, exports);
|
||||
|
||||
@@ -227,3 +228,18 @@ exports.start = function () {
|
||||
throw new Error("iOS Application already started!");
|
||||
}
|
||||
}
|
||||
|
||||
global.__onLiveSync = function () {
|
||||
if (!started) {
|
||||
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