src/store/indexeddb-local-backend.js
function() {
        return new Promise((resolve, reject) => {
            console.log(`Removing indexeddb instance: ${this._dbName}`);
            const req = this.indexedDB.deleteDatabase(this._dbName);

            req.onblocked = () => {
                console.log(
                    `can't yet delete indexeddb ${this._dbName}` +
                    ` because it is open elsewhere`,
                );
            };

            req.onerror = (ev) => {
                // in firefox, with indexedDB disabled, this fails with a
                // DOMError. We treat this as non-fatal, so that we can still
                // use the app.
                console.warn(
                    `unable to delete js-sdk store indexeddb: ${ev.target.error}`,
                );
                resolve();
            };

            req.onsuccess = () => {
                console.log(`Removed indexeddb instance: ${this._dbName}`);
                resolve();
            };
        });
    }
function() {
        return new Promise((resolve, reject) => {
            console.log(`Removing indexeddb instance: ${this._dbName}`);
            const req = this.indexedDB.deleteDatabase(this._dbName);

            req.onblocked = () => {
                console.log(
                    `can't yet delete indexeddb ${this._dbName}` +
                    ` because it is open elsewhere`,
                );
            };

            req.onerror = (ev) => {
                // in firefox, with indexedDB disabled, this fails with a
                // DOMError. We treat this as non-fatal, so that we can still
                // use the app.
                console.warn(
                    `unable to delete js-sdk store indexeddb: ${ev.target.error}`,
                );
                resolve();
            };

            req.onsuccess = () => {
                console.log(`Removed indexeddb instance: ${this._dbName}`);
                resolve();
            };
        });
    }
function ( ) { return new Promise ( ( resolve , reject ) => { console . log ( ` ${ this . _dbName } ` ) ; const req = this . indexedDB . deleteDatabase ( this . _dbName ) ; req . onblocked = ( ) => { console . log ( ` ${ this . _dbName } ` + ` ` , ) ; } ; req . onerror = ( ev ) => { // in firefox, with indexedDB disabled, this fails with a // DOMError. We treat this as non-fatal, so that we can still // use the app. console . warn ( ` ${ ev . target . error } ` , ) ; resolve ( ) ; } ; req . onsuccess = ( ) => { console . log ( ` ${ this . _dbName } ` ) ; resolve ( ) ; } ; } ) ; }
Clear the entire database. This should be used when logging out of a client
to prevent mixing data between accounts.
@return {Promise} Resolved when the database is cleared.
Clear the entire database . This should be used when logging out of a client to prevent mixing data between accounts .