diff --git a/src/rust-crypto/backup.ts b/src/rust-crypto/backup.ts index b969013eb10..df55bc3f160 100644 --- a/src/rust-crypto/backup.ts +++ b/src/rust-crypto/backup.ts @@ -207,15 +207,18 @@ export class RustBackupManager extends TypedEventEmitter { - const importOpt: ImportRoomKeyProgressData = { - total: Number(total), - successes: Number(progress), - stage: "load_keys", - failures: 0, - }; - opts?.progressCallback?.(importOpt); - }); + await this.olmMachine.importBackedUpRoomKeys( + keysByRoom, + (progress: BigInt, total: BigInt, failures?: BigInt): void => { + const importOpt: ImportRoomKeyProgressData = { + total: Number(total), + successes: Number(progress), + stage: "load_keys", + failures: failures == undefined ? 0 : Number(failures), + }; + opts?.progressCallback?.(importOpt); + }, + ); } private keyBackupCheckInProgress: Promise | null = null;