load battery percentage later

This commit is contained in:
liamcottle
2025-02-16 17:52:09 +13:00
parent bd9c8d49d4
commit 38e3375815

View File

@@ -145,7 +145,6 @@ class Connection {
// initial setup without needing database
await this.loadSelfInfo();
await this.syncDeviceTime();
await this.updateBatteryPercentage();
// wait for database to be ready
await databaseToBeReady;
@@ -153,6 +152,7 @@ class Connection {
// fetch data after database is ready
await this.loadContacts();
await this.syncMessages();
await this.updateBatteryPercentage();
// auto update battery percentage once per minute
setInterval(async () => {
@@ -288,10 +288,6 @@ class Connection {
await GlobalState.connection.reboot();
}
static async getBatteryVoltage() {
return await GlobalState.connection.getBatteryVoltage();
}
static async onContactMessageReceived(message) {
console.log("onContactMessageReceived", message);