Enhance NativeShell for JMP.
This commit is contained in:
@@ -275,7 +275,7 @@ const supportedFeatures = function () {
|
||||
*/
|
||||
function doExit() {
|
||||
try {
|
||||
if (window.NativeShell) {
|
||||
if (window.NativeShell && window.NativeShell.AppHost.exit) {
|
||||
window.NativeShell.AppHost.exit();
|
||||
} else if (browser.tizen) {
|
||||
tizen.application.getCurrentApplication().exit();
|
||||
@@ -360,10 +360,12 @@ export const appHost = {
|
||||
};
|
||||
},
|
||||
deviceName: function () {
|
||||
return window.NativeShell ? window.NativeShell.AppHost.deviceName() : getDeviceName();
|
||||
return window.NativeShell && window.NativeShell.AppHost.deviceName
|
||||
? window.NativeShell.AppHost.deviceName() : getDeviceName();
|
||||
},
|
||||
deviceId: function () {
|
||||
return window.NativeShell ? window.NativeShell.AppHost.deviceId() : getDeviceId();
|
||||
return window.NativeShell && window.NativeShell.AppHost.deviceId
|
||||
? window.NativeShell.AppHost.deviceId() : getDeviceId();
|
||||
},
|
||||
appName: function () {
|
||||
return window.NativeShell ? window.NativeShell.AppHost.appName() : appName;
|
||||
|
||||
@@ -3,6 +3,8 @@ import globalize from '../scripts/globalize';
|
||||
import loading from './loading/loading';
|
||||
import appSettings from '../scripts/settings/appSettings';
|
||||
import { playbackManager } from './playback/playbackmanager';
|
||||
import { appHost } from '../components/apphost';
|
||||
import { appRouter } from '../components/appRouter';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
@@ -90,7 +92,10 @@ import { playbackManager } from './playback/playbackmanager';
|
||||
events: Events,
|
||||
loading,
|
||||
appSettings,
|
||||
playbackManager
|
||||
playbackManager,
|
||||
globalize,
|
||||
appHost,
|
||||
appRouter
|
||||
});
|
||||
} else {
|
||||
console.debug(`Loading plugin (via dynamic import): ${pluginSpec}`);
|
||||
|
||||
Reference in New Issue
Block a user