Merge pull request #4395 from vector-im/rav/fix_braindead_firefox

Fix load failure in firefox when indexedDB is disabled
This commit is contained in:
David Baker 2017-06-22 15:30:01 +01:00 committed by GitHub
commit a1132ca7aa
1 changed files with 10 additions and 2 deletions

View File

@ -410,8 +410,16 @@ module.exports = {
}
logger = new ConsoleLogger();
logger.monkeyPatch(window.console);
if (window.indexedDB) {
store = new IndexedDBLogStore(window.indexedDB, logger);
// just *accessing* indexedDB throws an exception in firefox with
// indexeddb disabled.
let indexedDB;
try {
indexedDB = window.indexedDB;
} catch(e) {}
if (indexedDB) {
store = new IndexedDBLogStore(indexedDB, logger);
initPromise = store.connect();
return initPromise;
}