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