Skip to content

Commit

Permalink
Avoid checking key backup status if guest
Browse files Browse the repository at this point in the history
Fixes element-hq/element-web#7839.

Signed-off-by: J. Ryan Stinnett <[email protected]>
  • Loading branch information
jryans committed Dec 12, 2018
1 parent 2d3669b commit d7ac4e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/unit/crypto.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe("Crypto", function() {
mockBaseApis = {
sendToDevice: expect.createSpy(),
getKeyBackupVersion: expect.createSpy(),
isGuest: expect.createSpy(),
};
mockRoomList = {};

Expand Down
5 changes: 5 additions & 0 deletions src/crypto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ Crypto.prototype.init = async function() {
*/
Crypto.prototype._checkAndStartKeyBackup = async function() {
console.log("Checking key backup status...");
if (this._baseApis.isGuest()) {
console.log("Skipping key backup check since user is guest");
this._checkedForBackup = true;
return;
}
let backupInfo;
try {
backupInfo = await this._baseApis.getKeyBackupVersion();
Expand Down

0 comments on commit d7ac4e8

Please sign in to comment.