From 932d2c0d9dc22d3826c5aae273a762e880390017 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 11 Jan 2024 10:06:38 +0000 Subject: [PATCH] On Gadgetbridge, ensure the default data handler is set rather than built into bangleRx. This means that when comms.js does its hacky thing to replace the data handler it doesn't end up duplicating handlers. Fixes #3151 --- android.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/android.html b/android.html index d1d5b400a..a6f393e25 100644 --- a/android.html +++ b/android.html @@ -248,12 +248,14 @@ if (typeof Android!=="undefined") { hadData : false, handlers : [] } + connection.on("data", function(d) { + connection.received += d; + connection.hadData = true; + if (connection.cb) connection.cb(d); + }); function bangleRx(data) { // document.getElementById("status").innerText = "RX:"+data; - connection.received += data; - connection.hadData = true; - if (connection.cb) connection.cb(data); // call data event if (connection.handlers["data"]) connection.handlers["data"](data);