You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Merge pull request #473 from matrix-org/rav/no_require_indexeddb
Fix failure on Tor browser
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
var matrixcs = require("./lib/matrix");
|
var matrixcs = require("./lib/matrix");
|
||||||
matrixcs.request(require("browser-request"));
|
matrixcs.request(require("browser-request"));
|
||||||
|
|
||||||
matrixcs.setCryptoStoreFactory(
|
// if our browser (appears to) support indexeddb, use an indexeddb crypto store.
|
||||||
|
if (global.indexedDB) {
|
||||||
|
matrixcs.setCryptoStoreFactory(
|
||||||
function() {
|
function() {
|
||||||
return new matrixcs.IndexedDBCryptoStore(
|
return new matrixcs.IndexedDBCryptoStore(
|
||||||
global.indexedDB, "matrix-js-sdk:crypto"
|
global.indexedDB, "matrix-js-sdk:crypto"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = matrixcs; // keep export for browserify package deps
|
module.exports = matrixcs; // keep export for browserify package deps
|
||||||
global.matrixcs = matrixcs;
|
global.matrixcs = matrixcs;
|
||||||
|
|||||||
Reference in New Issue
Block a user