diff --git a/accelerator-home-ui/settings.json b/accelerator-home-ui/settings.json index 44f087c..38709b8 100644 --- a/accelerator-home-ui/settings.json +++ b/accelerator-home-ui/settings.json @@ -13,6 +13,6 @@ "log": true, "enableAppSuspended": true, "showVersion": false, - "version": "5.0.9" + "version": "5.0.12" } } diff --git a/accelerator-home-ui/src/App.js b/accelerator-home-ui/src/App.js index e46b78c..f69cd3b 100644 --- a/accelerator-home-ui/src/App.js +++ b/accelerator-home-ui/src/App.js @@ -807,19 +807,13 @@ export default class App extends Router.App { try { await appApi.getPluginStatus("Cobalt").then(async res => { params.applications.push({ - "cors": [".youtube.com"], + "cors": ".youtube.com", "name": "YouTube", - "prefix": "myYoutube", - "properties": { - "allowStop": false - } + "prefix": "myYoutube" }, { - "cors": [".youtube.com"], + "cors": ".youtube.com", "name": "YouTubeTV", - "prefix": "myYouTubeTV", - "properties": { - "allowStop": false - } + "prefix": "myYouTubeTV" }); }); } catch (e) { @@ -828,12 +822,9 @@ export default class App extends Router.App { try { await appApi.getPluginStatus("Amazon").then(async res => { params.applications.push({ - "name": ["AmazonInstantVideo"], - "prefixes": ["myPrimeVideo"], - "cors": [".amazon.com"], - "properties": { - "allowStop": true - } + "name": "AmazonInstantVideo", + "prefix": "myPrimeVideo", + "cors": ".amazon.com" }) }); } catch (e) { @@ -843,11 +834,8 @@ export default class App extends Router.App { await appApi.getPluginStatus("Netflix").then(async res => { params.applications.push({ "name": "Netflix", - "prefixes": ["myNetflix"], - "cors": [".netflix.com"], - "properties": { - "allowStop": true - } + "prefix": "myNetflix", + "cors": ".netflix.com" }) }); } catch (e) { diff --git a/accelerator-home-ui/src/items/AppCatalogItem.js b/accelerator-home-ui/src/items/AppCatalogItem.js index 70abe6b..269941e 100644 --- a/accelerator-home-ui/src/items/AppCatalogItem.js +++ b/accelerator-home-ui/src/items/AppCatalogItem.js @@ -211,7 +211,7 @@ export default class AppCatalogItem extends Lightning.Component { } let installedApps = await getInstalledDACApps() this._app.isInstalled = installedApps.find((a) => { - return a.id === this._app.id + return a.id === this._app.id && a.installed && a.installed.length > 0 }) if (this._app.isInstalled === undefined) this._app.isInstalled = false diff --git a/accelerator-home-ui/src/items/AppStoreItem.js b/accelerator-home-ui/src/items/AppStoreItem.js index 0e9e670..43d6d8b 100644 --- a/accelerator-home-ui/src/items/AppStoreItem.js +++ b/accelerator-home-ui/src/items/AppStoreItem.js @@ -71,7 +71,9 @@ export default class AppStoreItem extends Lightning.Component { src: data.icon, }); } - this.tag('Text').text.text = data.installed[0].appName + if (data.installed && data.installed.length > 0 && data.installed[0].appName) { + this.tag('Text').text.text = data.installed[0].appName; + } } static get width() { @@ -90,10 +92,12 @@ export default class AppStoreItem extends Lightning.Component { this._app.isUnInstalling = false this._buttonIndex = 0; if (Storage.get("CloudAppStore")) { - let icon = await fetchAppIcon(this.data.id, this.data.installed[0].version) - this.tag('Image').patch({ - src: icon, - }); + if (this.data.installed && this.data.installed.length > 0 && this.data.installed[0].version) { + let icon = await fetchAppIcon(this.data.id, this.data.installed[0].version) + this.tag('Image').patch({ + src: icon, + }); + } } else { let icon = await fetchLocalAppIcon(this.data.id) @@ -118,11 +122,13 @@ export default class AppStoreItem extends Lightning.Component { this.tag("Text").alpha = 0 } async _handleEnter() { - this._app.url = this.data.installed[0].url - this._app.id = this.data.id - this._app.name = this.data.installed[0].appName - this._app.version = this.data.installed[0].version - this._app.type = this.data.type - this._app.isRunning = await startDACApp(this._app); + if (this.data.installed && this.data.installed.length > 0) { + this._app.url = this.data.installed[0].url + this._app.id = this.data.id + this._app.name = this.data.installed[0].appName + this._app.version = this.data.installed[0].version + this._app.type = this.data.type + this._app.isRunning = await startDACApp(this._app); + } } } diff --git a/accelerator-home-ui/src/items/ManageAppItem.js b/accelerator-home-ui/src/items/ManageAppItem.js index 9d55ab6..7d34252 100644 --- a/accelerator-home-ui/src/items/ManageAppItem.js +++ b/accelerator-home-ui/src/items/ManageAppItem.js @@ -83,7 +83,9 @@ export default class ManageAppItem extends Lightning.Component { src: data.icon, }); } - this.tag('Text').text.text = data.installed[0].appName + if (data.installed && data.installed.length > 0 && data.installed[0].appName) { + this.tag('Text').text.text = data.installed[0].appName; + } } static get width() { diff --git a/accelerator-home-ui/src/views/AppStore.js b/accelerator-home-ui/src/views/AppStore.js index 8412746..c03b418 100644 --- a/accelerator-home-ui/src/views/AppStore.js +++ b/accelerator-home-ui/src/views/AppStore.js @@ -98,7 +98,10 @@ export default class AppStore extends Lightning.Component { this.options = { 0: async () => { const installedApplications = await getInstalledDACApps() - this.tag('Apps').add(installedApplications.map((element) => { + const appsWithInstalled = installedApplications.filter(app => + app.installed && app.installed.length > 0 + ) + this.tag('Apps').add(appsWithInstalled.map((element) => { return { h: AppStoreItem.height + 90, w: AppStoreItem.width, info: element } })); }, @@ -109,13 +112,19 @@ export default class AppStore extends Lightning.Component { }, 2: async () => { const installedApplications = await getInstalledDACApps() - this.tag('ManagedApps').add(installedApplications.map((element) => { + const appsWithInstalled = installedApplications.filter(app => + app.installed && app.installed.length > 0 + ) + this.tag('ManagedApps').add(appsWithInstalled.map((element) => { return { h: ManageAppItem.height + 90, w: ManageAppItem.width, info: element } })); }, } const installedApps = await getInstalledDACApps() - if (Object.keys(installedApps).length === 0) { + const appsWithInstalled = installedApps.filter(app => + app.installed && app.installed.length > 0 + ) + if (appsWithInstalled.length === 0) { this.tag('Options').setIndex(1) this.options[1]() this._setState('Catalog')