Skip to content

Commit 242240c

Browse files
committed
Fix bytesSent
1 parent a426f1b commit 242240c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/js/protocols/WebBluetooth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,11 @@ class WebBluetooth extends EventTarget {
365365
this.lastWrite = this.writeCharacteristic.writeValue(dataBuffer);
366366
await this.lastWrite;
367367
this.bytesSent += data.byteLength;
368-
368+
369369
if (cb) {
370370
cb({
371371
error: null,
372-
bytesSent: this.bytesSent,
372+
bytesSent: data.byteLength,
373373
});
374374
}
375375
} catch (e) {

src/js/protocols/WebSocket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ class Websocket extends EventTarget {
112112
try {
113113
this.ws.send(data);
114114
this.bytesSent += data.byteLength;
115-
115+
116116
if (cb) {
117117
cb({
118118
error: null,
119-
bytesSent: this.bytesSent,
119+
bytesSent: data.byteLength,
120120
});
121121
}
122122
} catch (e) {

0 commit comments

Comments
 (0)