1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00
Files
matrix-js-sdk/browser-index.js
Richard van der Hoff 8ef947722f Fail gracefully on browsers without indexeddb
If we don't have indexeddb at all, don't try to make an indexeddb crypto store.
2017-06-22 07:49:28 +01:00

17 lines
493 B
JavaScript

var matrixcs = require("./lib/matrix");
matrixcs.request(require("browser-request"));
// if our browser (appears to) support indexeddb, use an indexeddb crypto store.
if (global.indexedDB) {
matrixcs.setCryptoStoreFactory(
function() {
return new matrixcs.IndexedDBCryptoStore(
global.indexedDB, "matrix-js-sdk:crypto"
);
}
);
}
module.exports = matrixcs; // keep export for browserify package deps
global.matrixcs = matrixcs;