persistence db fixes
This commit is contained in:
parent
76ad58bb59
commit
fdbb558ce2
@ -1,11 +1,12 @@
|
||||
|
||||
import Y from '../src/y.js'
|
||||
import yArray from '../../y-array/src/y-array.js'
|
||||
import yIndexedDB from '../../y-indexeddb/src/y-indexeddb.js'
|
||||
import yMap from '../../y-map/src/y-map.js'
|
||||
import yText from '../../y-text/src/Text.js'
|
||||
import yXml from '../../y-xml/src/y-xml.js'
|
||||
import yWebsocketsClient from '../../y-websockets-client/src/y-websockets-client.js'
|
||||
|
||||
Y.extend(yArray, yMap, yText, yXml, yWebsocketsClient)
|
||||
Y.extend(yArray, yIndexedDB, yMap, yText, yXml, yWebsocketsClient)
|
||||
|
||||
export default Y
|
||||
|
13
src/y.js
13
src/y.js
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user