From 3bbca52f36237e92265749ee86069468460488a1 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sat, 13 Jan 2024 11:49:00 +0000 Subject: [PATCH 1/3] sendCustomizedApp() allows a noFinish setting This will allow `interface.html`s like `fwupdate` to continue making changes. See https://github.com/espruino/BangleApps/issues/3153 --- js/index.js | 2 +- lib/customize.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/index.js b/js/index.js index 8e7b6d4..83f7c3c 100644 --- a/js/index.js +++ b/js/index.js @@ -353,7 +353,7 @@ function handleCustomApp(appTemplate) { getInstalledApps() .then(()=>checkDependencies(app)) - .then(()=>Comms.uploadApp(app,{device:device, language:LANGUAGE})) + .then(()=>Comms.uploadApp(app,{device:device, language:LANGUAGE, noFinish:msg.noFinish})) .then(()=>{ Progress.hide({sticky:true}); resolve(); diff --git a/lib/customize.js b/lib/customize.js index d8a45f4..135282b 100644 --- a/lib/customize.js +++ b/lib/customize.js @@ -58,11 +58,12 @@ Util.saveCSV(filename, csvData) // pop up a dialog to save a CSV Util.showModal(title) // show a modal screen over everything in this window Util.hideModal() // hide the modal from showModal */ -function sendCustomizedApp(app) { +function sendCustomizedApp(app, noFinish) { console.log(" sending app"); window.postMessage({ type : "app", - data : app + data : app, + noFinish }); } From 786f90425c0442c0e3419f74baa9283057a4df70 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 15 Jan 2024 20:52:27 +0000 Subject: [PATCH 2/3] sendCustomizedApp(): move noFinish to options --- js/index.js | 2 +- lib/customize.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/index.js b/js/index.js index 83f7c3c..f999fef 100644 --- a/js/index.js +++ b/js/index.js @@ -353,7 +353,7 @@ function handleCustomApp(appTemplate) { getInstalledApps() .then(()=>checkDependencies(app)) - .then(()=>Comms.uploadApp(app,{device:device, language:LANGUAGE, noFinish:msg.noFinish})) + .then(()=>Comms.uploadApp(app,{device:device, language:LANGUAGE, noFinish: msg.options && msg.options.noFinish})) .then(()=>{ Progress.hide({sticky:true}); resolve(); diff --git a/lib/customize.js b/lib/customize.js index 135282b..8323fce 100644 --- a/lib/customize.js +++ b/lib/customize.js @@ -58,12 +58,12 @@ Util.saveCSV(filename, csvData) // pop up a dialog to save a CSV Util.showModal(title) // show a modal screen over everything in this window Util.hideModal() // hide the modal from showModal */ -function sendCustomizedApp(app, noFinish) { +function sendCustomizedApp(app, options) { console.log(" sending app"); window.postMessage({ type : "app", data : app, - noFinish + options }); } From 41e586e3bb1025253ebdaa27a6be32e19619837f Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 15 Jan 2024 20:52:34 +0000 Subject: [PATCH 3/3] sendCustomizedApp(): document options / noFinish --- lib/customize.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/customize.js b/lib/customize.js index 8323fce..7d0251f 100644 --- a/lib/customize.js +++ b/lib/customize.js @@ -33,6 +33,9 @@ onInit({ }); ``` +Pass `{ noFinish: true }` as the second argument to skip reloading +the connected device. + If no device is connected, some fields may not be populated. This exposes a 'Puck' object (a simple version of