summaryrefslogtreecommitdiff
path: root/xP/public
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-08 02:33:44 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-08 02:45:37 +0200
commit8c3ee80b21278eaa6fb29f73b79c16d443923dfa (patch)
treec943fe17e888c75c17ff7c9866373ac23acb4d45 /xP/public
parent3a165a595ba75958d360a61fdb173b19f71096dd (diff)
downloadxK-8c3ee80b21278eaa6fb29f73b79c16d443923dfa.tar.gz
xK-8c3ee80b21278eaa6fb29f73b79c16d443923dfa.tar.xz
xK-8c3ee80b21278eaa6fb29f73b79c16d443923dfa.zip
xC/xP: finalize and implement Event.PING
Diffstat (limited to 'xP/public')
-rw-r--r--xP/public/xP.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index 42a7a55..eb27b46 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -85,7 +85,8 @@ class RelayRpc extends EventTarget {
if (typeof e.event !== 'string')
throw "Invalid event tag"
- this.dispatchEvent(new CustomEvent(e.event, {detail: e}))
+ this.dispatchEvent(new CustomEvent(
+ e.event, {detail: {eventSeq: message.eventSeq, ...e}}))
// Minor abstraction layering violation.
m.redraw()
@@ -153,6 +154,10 @@ rpc.addEventListener('close', event => {
m.redraw()
})
+rpc.addEventListener('Ping', event => {
+ rpc.send({command: 'PingResponse', eventSeq: event.detail.eventSeq})
+})
+
rpc.addEventListener('BufferUpdate', event => {
let e = event.detail, b = buffers.get(e.bufferName)
if (b === undefined) {