src/store/indexeddb-local-backend.js
function() {
        console.log(
            `LocalIndexedDBStoreBackend: loading sync data...`,
        );
        return Promise.try(() => {
            const txn = this.db.transaction(["sync"], "readonly");
            const store = txn.objectStore("sync");
            return selectQuery(store, undefined, (cursor) => {
                return cursor.value;
            }).then((results) => {
                console.log(
                    `LocalIndexedDBStoreBackend: loaded sync data`,
                );
                if (results.length > 1) {
                    console.warn("loadSyncData: More than 1 sync row found.");
                }
                return (results.length > 0 ? results[0] : {});
            });
        });
    }
function() {
        console.log(
            `LocalIndexedDBStoreBackend: loading sync data...`,
        );
        return Promise.try(() => {
            const txn = this.db.transaction(["sync"], "readonly");
            const store = txn.objectStore("sync");
            return selectQuery(store, undefined, (cursor) => {
                return cursor.value;
            }).then((results) => {
                console.log(
                    `LocalIndexedDBStoreBackend: loaded sync data`,
                );
                if (results.length > 1) {
                    console.warn("loadSyncData: More than 1 sync row found.");
                }
                return (results.length > 0 ? results[0] : {});
            });
        });
    }
function ( ) { console . log ( ` ` , ) ; return Promise . try ( ( ) => { const txn = this . db . transaction ( [ "sync" ] , "readonly" ) ; const store = txn . objectStore ( "sync" ) ; return selectQuery ( store , undefined , ( cursor ) => { return cursor . value ; } ) . then ( ( results ) => { console . log ( ` ` , ) ; if ( results . length > 1 ) { console . warn ( "loadSyncData: More than 1 sync row found." ) ; } return ( results . length > 0 ? results [ 0 ] : { } ) ; } ) ; } ) ; }
Load the sync data from the database.
@return {Promise<Object>} An object with "roomsData" and "nextBatch" keys.
Load the sync data from the database .