mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-25 16:50:44 +02:00
Webview: Fix sending configuration from watchfaces when background message exchange is going on
This commit is contained in:
parent
d669d3b325
commit
b8a137226f
@ -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>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user