From 2d7dc0d640437b13f3b78791bf8338ae588e7b45 Mon Sep 17 00:00:00 2001 From: reisxd <29177546+reisxd@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:35:31 +0300 Subject: [PATCH] fix: fix launch app control and service autolaunch --- tizenbrew-app/TizenBrew/config.xml | 2 +- tizenbrew-app/TizenBrew/js/wsClient.js | 4 ++-- tizenbrew-app/TizenBrew/service/serviceLauncher.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tizenbrew-app/TizenBrew/config.xml b/tizenbrew-app/TizenBrew/config.xml index 852cd3a..1fedb7f 100644 --- a/tizenbrew-app/TizenBrew/config.xml +++ b/tizenbrew-app/TizenBrew/config.xml @@ -1,5 +1,5 @@ - + diff --git a/tizenbrew-app/TizenBrew/js/wsClient.js b/tizenbrew-app/TizenBrew/js/wsClient.js index 971243f..0b0d587 100644 --- a/tizenbrew-app/TizenBrew/js/wsClient.js +++ b/tizenbrew-app/TizenBrew/js/wsClient.js @@ -104,7 +104,7 @@ function onMessage(msg) { const autoLaunchService = JSON.parse(localStorage.getItem('autoLaunchService')); if (autoLaunchService) { - send({ type: 'startService', package: autoLaunchService }); + send({ type: 'startService', package: `${autoLaunchService.type}/${autoLaunchService.name}` }); } if (message.appControlData) { @@ -174,7 +174,7 @@ function onOpen() { const moduleType = parsedData.moduleType; const args = parsedData.args; // Send the data to the server and launch it after TizenBrew relaunches. - send({ type: 'launchAppControl', package: { name: moduleName, type: moduleType }, args }); + send({ type: 'launchAppControl', package: `${moduleType}/${moduleName}`, args }); } catch (e) { send({ type: 'getDebugStatus' }); } diff --git a/tizenbrew-app/TizenBrew/service/serviceLauncher.js b/tizenbrew-app/TizenBrew/service/serviceLauncher.js index 57f5f8f..6e30269 100644 --- a/tizenbrew-app/TizenBrew/service/serviceLauncher.js +++ b/tizenbrew-app/TizenBrew/service/serviceLauncher.js @@ -14,6 +14,7 @@ function startService(module, pkg) { }); sandbox['require'] = require; + sandbox['tizen'] = global.tizen; sandbox['module'] = { exports: {} }; fetch(`https://cdn.jsdelivr.net/${pkg}/${module.serviceFile}`) .then(res => res.text())