fixed bugs resolving from new init style

This commit is contained in:
Kevin Jahns
2015-12-03 17:27:13 +01:00
parent 709779425c
commit 7753994e36
4 changed files with 51 additions and 14 deletions

View File

@@ -115,7 +115,15 @@ class YConfig {
this.db.requestTransaction(function * requestTransaction () {
// create shared object
for (var propertyname in opts.share) {
share[propertyname] = yield* this.getType(['_', opts.share[propertyname] + '_' + propertyname])
var typename = opts.share[propertyname]
var id = ['_', Y[typename].struct + '_' + propertyname]
var op = yield* this.getOperation(id)
if (op.type !== typename) {
// not already in the db
op.type = typename
yield* this.setOperation(op)
}
share[propertyname] = yield* this.getType(id)
}
setTimeout(callback, 0)
})