mirror of
https://github.com/aljazceru/meshcore-web.git
synced 2025-12-18 00:24:21 +01:00
sync device time on connect
This commit is contained in:
@@ -43,6 +43,7 @@ class Connection {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await this.loadSelfInfo();
|
await this.loadSelfInfo();
|
||||||
|
await this.syncDeviceTime();
|
||||||
await this.loadContacts();
|
await this.loadContacts();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -59,6 +60,11 @@ class Connection {
|
|||||||
GlobalState.contacts = await GlobalState.connection.getContacts();
|
GlobalState.contacts = await GlobalState.connection.getContacts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async syncDeviceTime() {
|
||||||
|
const timestamp = Math.floor(Date.now() / 1000);
|
||||||
|
await GlobalState.connection.sendCommandSetDeviceTime(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Connection;
|
export default Connection;
|
||||||
|
|||||||
Reference in New Issue
Block a user