1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-03 11:33:19 +02:00

Webview: Fix sending configuration from watchfaces when background message exchange is going on

This commit is contained in:
Daniele Gobbetti 2017-09-03 17:10:04 +02:00
parent d669d3b325
commit b8a137226f
2 changed files with 4 additions and 4 deletions

View File

@ -89,7 +89,7 @@
<div id="step2" class="step">
<h2>Incoming configuration data:</h2>
<div id="jsondata"></div>
<button class="btn" name="send config" value="send config" onclick="Pebble.actuallySendData()">
<button class="btn" name="send config" value="send config" onclick="Pebble.sendConfiguration()">
Send data to pebble
</button>
<h2 class="store_presets">App Presets:</h2>

View File

@ -138,8 +138,8 @@ function gbPebble() {
window.open(self.configurationURL.toString(), "config");
}
this.actuallySendData = function() {
GBjs.sendAppMessage(self.configurationValues, false );
this.sendConfiguration = function() {
GBjs.sendAppMessage(document.getElementById("jsondata").innerHTML, false );
showStep("step1");
GBActivity.closeActivity();
}
@ -189,7 +189,7 @@ function gbPebble() {
this.sendAppMessage = function (dict, callbackAck, callbackNack){
try {
self.configurationValues = JSON.stringify(dict);
if (document.getElementById("step2").style.display == 'block') { //intercept the values
if (document.getElementById("step2").style.display == 'block' && document.getElementById("jsondata").innerHTML == "") { //intercept the values
document.getElementById("jsondata").innerHTML=self.configurationValues;
} else { //pass them silently
var needsTransaction = false;