aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/apps.js
diff options
context:
space:
mode:
authorJose Dapena Paz <jdapena@igalia.com>2022-02-26 12:16:16 +0100
committerJose Dapena Paz <jdapena@igalia.com>2022-03-01 18:04:03 +0100
commit8ad6b022196ec689eed08c0f3315a53723d4af0c (patch)
treead749ca05d0c3948beec81d4f0c3f3a852e8456a /src/js/apps.js
parent48970567f1943fb70ef1526827c21548d23695e7 (diff)
Migrate to new application framework
First, move to use the appService API added as injection in AGL chromium. Then, added stubs for the network and weather APIs as there is no API available right now for them. Bug-AGL: SPEC-4250 Signed-off-by: Jose Dapena Paz <jdapena@igalia.com> Change-Id: I974097edcef6318585e4e79360dbec6fea7cf480
Diffstat (limited to 'src/js/apps.js')
-rw-r--r--src/js/apps.js17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/js/apps.js b/src/js/apps.js
index 9fe7107..e3e0158 100644
--- a/src/js/apps.js
+++ b/src/js/apps.js
@@ -1,5 +1,4 @@
import { load as load_template } from './templates';
-import { homescreen, afmMain } from 'agl-js-api';
import Mustache from 'mustache';
var configjson = require('../config.json');
@@ -15,26 +14,24 @@ function show() {
function locateApp(appId, appList) {
return appList.find(function(app){
- return app.id.split('@')[0] === appId
+ return app[0].split('@')[0] === appId
});
}
function load_application_list() {
- afmMain.runnables().then(function(result) {
+ navigator.appService.getApplications(true, result => {
configjson.apps.forEach(function(app) {
var internalApp = locateApp(app.id, result);
if( internalApp ) {
page.apps.push({
- id: internalApp.id,
- name: internalApp.name,
+ id: internalApp[0],
+ name: internalApp[1],
icon: app.icon
});
if( app.id === configjson.launch ) {
- afmMain.start(internalApp.id).then(function(result) {
- console.log("success: " + result);
- });
+ navigator.appService.start(internalApp[0]);
}
}
@@ -45,9 +42,7 @@ function load_application_list() {
}
export function start(appId) {
- homescreen.showWindow(appId.split('@')[0]).then(function(result) {
- console.log("success: " + result);
- });
+ navigator.appService.start(appId.split('@')[0]);
}
export function init(node) {