paldepind/synceddb

property 'put' of undefined

MaartenProvo opened this issue · 2 comments

Perhaps a stupid question, I get an error can not read property 'put' of undefined. But I can't find how to fix it, searched in the example files, but no clues there.

Anamnese - Pc v4.html.txt
DB-Ambu-4.js.txt

syncedDB.open().then() doesn't return db. So I guess this will work.

var db = syncedDB.open({
    name: 'Ambu-DB',
    // ...
});
db.then(function() {
    addPatients();
}).catch(function(err) {
    // ...
});

Or, because the argument of a function passed to SDBDatabase#then() is {db: db, e: e}, I think you can use that too.

@MaartenProvo Tell me if you still have the problem even after the above answer.