From 0cb639816094dadd61c0041665b0930ec4827477 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Thu, 13 Feb 2025 01:06:01 +1300 Subject: [PATCH] sync device time on connect --- src/js/Connection.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/Connection.js b/src/js/Connection.js index b539d91..cc2d313 100644 --- a/src/js/Connection.js +++ b/src/js/Connection.js @@ -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;