Skip to content

Commit

Permalink
update emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Nov 26, 2024
1 parent 505dba9 commit ec72ca3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/webxdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ window.webxdc = (() => {

var params = new URLSearchParams(window.location.hash.substr(1));
return {
sendUpdateInterval: 1000,
sendUpdateMaxSize: 999999,
selfAddr: params.get("addr") || "device0@local.host",
selfName: params.get("name") || "device0",
setUpdateListener: (cb, serial = 0) => {
Expand Down Expand Up @@ -109,22 +111,22 @@ window.webxdc = (() => {
console.log("[Webxdc] WARNING: getAllUpdates() is deprecated.");
return Promise.resolve([]);
},
sendUpdate: (update, description) => {
sendUpdate: (update) => {
var updates = getUpdates();
var serial = updates.length + 1;
var _update = {
payload: update.payload,
summary: update.summary,
info: update.info,
notify: update.notify,
href: update.href,
document: update.document,
serial: serial,
};
updates.push(_update);
window.localStorage.setItem(updatesKey, JSON.stringify(updates));
_update.max_serial = serial;
console.log(
'[Webxdc] description="' + description + '", ' + JSON.stringify(_update)
);
console.log(`[Webxdc] ${JSON.stringify(_update)}`);
updateListener(_update);
},
sendToChat: async (content) => {
Expand Down

0 comments on commit ec72ca3

Please sign in to comment.