mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
update properly
This commit is contained in:
parent
447d15667c
commit
c1cd51bbb8
@ -1338,12 +1338,16 @@ WorkStore = assign({}, EventEmitter.prototype, {
|
||||
return this.removeListener("change", cb);
|
||||
},
|
||||
getData: function(arg) {
|
||||
var _tasks, i, id, len, sort, tasks;
|
||||
var _tasks, got, i, id, j, len, sort, tasks;
|
||||
sort = arg.sort, tasks = arg.tasks;
|
||||
_tasks = _.clone(tasks);
|
||||
for (i = 0, len = _list.length; i < len; i++) {
|
||||
for (i = j = 0, len = _list.length; j < len; i = ++j) {
|
||||
id = _list[i].id;
|
||||
if (!(got = _tasks[id])) {
|
||||
continue;
|
||||
}
|
||||
delete _tasks[id];
|
||||
_list[i] = this.itemFromData(got, i);
|
||||
}
|
||||
return sort.map((function(_this) {
|
||||
return function(k, index) {
|
||||
|
@ -70,8 +70,9 @@ WorkStore = assign {},EventEmitter.prototype,{
|
||||
|
||||
getData: ({sort,tasks})->
|
||||
_tasks = _.clone tasks
|
||||
for {id} in _list
|
||||
for {id},i in _list when got = _tasks[id]
|
||||
delete _tasks[id]
|
||||
_list[i] = @itemFromData got,i
|
||||
sort.map (k,index)=>
|
||||
if _tasks[k]
|
||||
@newItem {item:_tasks[k],index}
|
||||
|
Loading…
Reference in New Issue
Block a user