mirror of https://github.com/vector-im/riot-web
Review changes
parent
d746dc46f9
commit
9fba86cb99
|
@ -231,11 +231,12 @@ export default class DeviceListener {
|
||||||
if (!this.client) return null;
|
if (!this.client) return null;
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
const crypto = this.client.getCrypto();
|
const crypto = this.client.getCrypto();
|
||||||
|
if (!crypto) return null;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
crypto &&
|
!this.keyBackupInfo ||
|
||||||
(!this.keyBackupInfo ||
|
|
||||||
!this.keyBackupFetchedAt ||
|
!this.keyBackupFetchedAt ||
|
||||||
this.keyBackupFetchedAt < now - KEY_BACKUP_POLL_INTERVAL)
|
this.keyBackupFetchedAt < now - KEY_BACKUP_POLL_INTERVAL
|
||||||
) {
|
) {
|
||||||
this.keyBackupInfo = await crypto.getKeyBackupInfo();
|
this.keyBackupInfo = await crypto.getKeyBackupInfo();
|
||||||
this.keyBackupFetchedAt = now;
|
this.keyBackupFetchedAt = now;
|
||||||
|
|
|
@ -1638,7 +1638,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
} else {
|
} else {
|
||||||
// otherwise check the server to see if there's a new one
|
// otherwise check the server to see if there's a new one
|
||||||
try {
|
try {
|
||||||
newVersionInfo = (await cli.getCrypto()?.getKeyBackupInfo()) || null;
|
newVersionInfo = (await cli.getCrypto()?.getKeyBackupInfo()) ?? null;
|
||||||
if (newVersionInfo !== null) haveNewVersion = true;
|
if (newVersionInfo !== null) haveNewVersion = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Saw key backup error but failed to check backup version!", e);
|
logger.error("Saw key backup error but failed to check backup version!", e);
|
||||||
|
|
|
@ -258,7 +258,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const cli = MatrixClientPeg.safeGet();
|
const cli = MatrixClientPeg.safeGet();
|
||||||
const backupInfo = (await cli.getCrypto()?.getKeyBackupInfo()) || null;
|
const backupInfo = (await cli.getCrypto()?.getKeyBackupInfo()) ?? null;
|
||||||
const has4S = await cli.secretStorage.hasKey();
|
const has4S = await cli.secretStorage.hasKey();
|
||||||
const backupKeyStored = has4S ? await cli.isKeyBackupKeyStored() : null;
|
const backupKeyStored = has4S ? await cli.isKeyBackupKeyStored() : null;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -118,7 +118,7 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {
|
||||||
this.getUpdatedDiagnostics();
|
this.getUpdatedDiagnostics();
|
||||||
try {
|
try {
|
||||||
const cli = MatrixClientPeg.safeGet();
|
const cli = MatrixClientPeg.safeGet();
|
||||||
const backupInfo = (await cli.getCrypto()?.getKeyBackupInfo()) || null;
|
const backupInfo = (await cli.getCrypto()?.getKeyBackupInfo()) ?? null;
|
||||||
const backupTrustInfo = backupInfo ? await cli.getCrypto()?.isKeyBackupTrusted(backupInfo) : undefined;
|
const backupTrustInfo = backupInfo ? await cli.getCrypto()?.isKeyBackupTrusted(backupInfo) : undefined;
|
||||||
|
|
||||||
const activeBackupVersion = (await cli.getCrypto()?.getActiveSessionBackupVersion()) ?? null;
|
const activeBackupVersion = (await cli.getCrypto()?.getActiveSessionBackupVersion()) ?? null;
|
||||||
|
|
|
@ -125,7 +125,7 @@ export class SetupEncryptionStore extends EventEmitter {
|
||||||
this.emit("update");
|
this.emit("update");
|
||||||
try {
|
try {
|
||||||
const cli = MatrixClientPeg.safeGet();
|
const cli = MatrixClientPeg.safeGet();
|
||||||
const backupInfo = (await cli.getCrypto()?.getKeyBackupInfo()) || null;
|
const backupInfo = (await cli.getCrypto()?.getKeyBackupInfo()) ?? null;
|
||||||
this.backupInfo = backupInfo;
|
this.backupInfo = backupInfo;
|
||||||
this.emit("update");
|
this.emit("update");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue