adapt to the new specs of webxdc.sendUpdate()
This commit is contained in:
parent
eb59df379b
commit
79eb1e4a1e
|
@ -12,7 +12,7 @@
|
|||
|
||||
function sendMsg() {
|
||||
msg = document.getElementById("input").value;
|
||||
window.webxdc.sendUpdate({"name": window.webxdc.selfName(), "msg": msg}, 'someone typed "'+msg+'"');
|
||||
window.webxdc.sendUpdate({payload: {name: window.webxdc.selfName(), msg: msg}}, 'someone typed "'+msg+'"');
|
||||
}
|
||||
|
||||
function receiveUpdate(update) {
|
||||
|
|
|
@ -27,9 +27,9 @@ window.webxdc = (() => {
|
|||
var updatesJSON = window.localStorage.getItem(updatesKey);
|
||||
return updatesJSON ? JSON.parse(updatesJSON) : [];
|
||||
},
|
||||
sendUpdate: (payload, description) => {
|
||||
sendUpdate: (update, description) => {
|
||||
// alert(description+"\n\n"+JSON.stringify(payload));
|
||||
var update = {payload: payload};
|
||||
update = {payload: update.payload, summary: update.summary, info: update.info}
|
||||
console.log('[Webxdc] description="' + description + '", ' + JSON.stringify(update));
|
||||
updateListener(update);
|
||||
var updatesJSON = window.localStorage.getItem(updatesKey);
|
||||
|
|
Loading…
Reference in a new issue