mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Pebble: only call Pebble object in javascript if it is actually available
This commit is contained in:
parent
06929d04f9
commit
e657b327c9
@ -129,7 +129,7 @@ class PebbleIoThread extends GBDeviceIoThread {
|
||||
WebViewSingleton.invokeWebview(new WebViewSingleton.WebViewRunnable() {
|
||||
@Override
|
||||
public void invoke(WebView webView) {
|
||||
webView.evaluateJavascript("Pebble.evaluate('" + jsEvent + "',[" + appMessage + "]);", new ValueCallback<String>() {
|
||||
webView.evaluateJavascript("if (typeof Pebble == 'object') Pebble.evaluate('" + jsEvent + "',[" + appMessage + "]);", new ValueCallback<String>() {
|
||||
@Override
|
||||
public void onReceiveValue(String s) {
|
||||
//TODO: the message should be acked here instead of in PebbleIoThread
|
||||
|
Loading…
Reference in New Issue
Block a user