persistence db fixes

This commit is contained in:
Kevin Jahns
2017-09-11 16:02:19 +02:00
parent 76ad58bb59
commit fdbb558ce2
2 changed files with 7 additions and 9 deletions

View File

@@ -150,6 +150,9 @@ export default function Y (opts/* :YOptions */) /* :Promise<YConfig> */ {
}
}, opts.timeout)
}
if (yconfig.persistence != null) {
yconfig.persistence.retrieveContent()
}
yconfig.db.whenUserIdSet(function () {
yconfig.init(function () {
resolved = true
@@ -200,14 +203,8 @@ class YConfig extends Y.utils.NamedEventHandler {
share[propertyname] = this.store.initType.call(this, id, args)
}
})
if (this.persistence != null) {
this.persistence.retrieveContent()
.then(() => this.db.whenTransactionsFinished())
.then(callback)
} else {
this.db.whenTransactionsFinished()
.then(callback)
}
this.db.whenTransactionsFinished()
.then(callback)
}
isConnected () {
return this.connector.isSynced