Skip to content

Commit 7273bd5

Browse files
author
hoang.tran12
committed
who is typing - wip
1 parent 71f8f8a commit 7273bd5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/fb_whoIsTyping.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export default {
3131
websocket_instant.addEventListener("message", async function (achunk) {
3232
let utf8_str = new TextDecoder("utf-8").decode(achunk.data);
3333

34-
if (utf8_str.includes("updateTypingIndicator")) {
34+
if (
35+
utf8_str.includes("updateTypingIndicator") ||
36+
utf8_str.includes("mid.$")
37+
) {
3538
let isStartTyping = utf8_str.includes(",true)");
3639
let isStopTyping = utf8_str.includes(",false)");
3740

@@ -40,7 +43,7 @@ export default {
4043
JSON.parse(arr[arr.length - 2])
4144
);
4245

43-
console.log(uid, isStartTyping);
46+
console.log(uid, isStartTyping, utf8_str);
4447
saveTyingEvent(uid, isStartTyping);
4548
}
4649
});

0 commit comments

Comments
 (0)