Merge branch 'develop' into dbkr/key_backup_by_default

This commit is contained in:
David Baker 2024-12-02 14:44:46 +00:00 committed by GitHub
commit 6bff653339
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
477 changed files with 5526 additions and 16820 deletions

View file

@ -230,12 +230,15 @@ export default class DeviceListener {
private async getKeyBackupInfo(): Promise<KeyBackupInfo | null> {
if (!this.client) return null;
const now = new Date().getTime();
const crypto = this.client.getCrypto();
if (!crypto) return null;
if (
!this.keyBackupInfo ||
!this.keyBackupFetchedAt ||
this.keyBackupFetchedAt < now - KEY_BACKUP_POLL_INTERVAL
) {
this.keyBackupInfo = await this.client.getKeyBackupVersion();
this.keyBackupInfo = await crypto.getKeyBackupInfo();
this.keyBackupFetchedAt = now;
}
return this.keyBackupInfo;