mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
actually fix async maybe?
This commit is contained in:
parent
3a1170cedd
commit
f77ffac57c
@ -36,8 +36,8 @@ module.exports = (queries, Child, load=_load)-> recl
|
||||
request = {}
|
||||
for k of _queries when k isnt 'kids'
|
||||
request[k] = _queries[k] unless have[k] isnt undefined
|
||||
if _queries.kids? and have.kids?
|
||||
if _.isEmpty have.kids
|
||||
if _queries.kids?
|
||||
if not have.kids?
|
||||
request.kids = _queries.kids
|
||||
else
|
||||
request.kids = {}
|
||||
|
@ -356,8 +356,8 @@ module.exports = function(queries, Child, load) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((_queries.kids != null) && (have.kids != null)) {
|
||||
if (_.isEmpty(have.kids)) {
|
||||
if (_queries.kids != null) {
|
||||
if (have.kids == null) {
|
||||
request.kids = _queries.kids;
|
||||
} else {
|
||||
request.kids = {};
|
||||
@ -1707,14 +1707,20 @@ TreeStore = _.extend(EventEmitter.prototype, {
|
||||
}
|
||||
data[k] = have[k];
|
||||
}
|
||||
if (query.kids && !have.EMPTY) {
|
||||
if (query.kids) {
|
||||
if (have.EMPTY) {
|
||||
data.kids = {};
|
||||
} else {
|
||||
for (k in tree) {
|
||||
sub = tree[k];
|
||||
if (data.kids == null) {
|
||||
data.kids = {};
|
||||
}
|
||||
data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!_.isEmpty(data)) {
|
||||
return data;
|
||||
}
|
||||
|
@ -26,9 +26,11 @@ TreeStore = _.extend EventEmitter.prototype, {
|
||||
for k,t of query when QUERIES[k]
|
||||
if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'"
|
||||
data[k] = have[k]
|
||||
if query.kids and not have.EMPTY
|
||||
if query.kids
|
||||
if have.EMPTY
|
||||
data.kids = {}
|
||||
for k,sub of tree
|
||||
else for k,sub of tree
|
||||
data.kids ?= {}
|
||||
data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids
|
||||
data unless _.isEmpty data
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user