Merge pull request #24 from deltachat/set-default-serial-in-setUpdateListener
set default value for serial parameter in setUpdateListener
This commit is contained in:
commit
1c7c126a16
2
webxdc.d.ts
vendored
2
webxdc.d.ts
vendored
|
@ -40,7 +40,7 @@ interface Webxdc<T> {
|
|||
* The "serial" specifies the last serial that you know about (defaults to 0).
|
||||
* Note that own status updates, that you send with {@link sendUpdate}, also trigger this method
|
||||
* */
|
||||
setUpdateListener(cb: (statusUpdate: ReceivedStatusUpdate<T>) => void, serial: number): void;
|
||||
setUpdateListener(cb: (statusUpdate: ReceivedStatusUpdate<T>) => void, serial?: number): void;
|
||||
/**
|
||||
* WARNING! This function is deprecated, see setUpdateListener().
|
||||
*/
|
||||
|
|
|
@ -25,7 +25,7 @@ window.webxdc = (() => {
|
|||
return {
|
||||
selfAddr: params.get("addr") || "device0@local.host",
|
||||
selfName: params.get("name") || "device0",
|
||||
setUpdateListener: (cb, serial) => {
|
||||
setUpdateListener: (cb, serial = 0) => {
|
||||
var updates = getUpdates();
|
||||
var maxSerial = updates.length;
|
||||
updates.forEach((update) => {
|
||||
|
|
Loading…
Reference in a new issue