Skip to content

Commit

Permalink
Merge pull request #691 from vector-im/madlittlemods/only-crypto-in-s…
Browse files Browse the repository at this point in the history
…ecure-context

Only initialize `Crypto` when olm is provided
  • Loading branch information
bwindels authored Mar 3, 2022
2 parents c09964d + 2f4c639 commit 8b8233f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/web/Platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ export class Platform {
this._serviceWorkerHandler.registerAndStart(assetPaths.serviceWorker);
}
this.notificationService = new NotificationService(this._serviceWorkerHandler, config.push);
this.crypto = new Crypto(cryptoExtras);
// Only try to use crypto when olm is provided
if(this._assetPaths.olm) {
this.crypto = new Crypto(cryptoExtras);
}
this.storageFactory = new StorageFactory(this._serviceWorkerHandler);
this.sessionInfoStorage = new SessionInfoStorage("hydrogen_sessions_v1");
this.estimateStorageUsage = estimateStorageUsage;
Expand Down

0 comments on commit 8b8233f

Please sign in to comment.