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);
|
return this.removeListener("change", cb);
|
||||||
},
|
},
|
||||||
getData: function(arg) {
|
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;
|
sort = arg.sort, tasks = arg.tasks;
|
||||||
_tasks = _.clone(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;
|
id = _list[i].id;
|
||||||
|
if (!(got = _tasks[id])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
delete _tasks[id];
|
delete _tasks[id];
|
||||||
|
_list[i] = this.itemFromData(got, i);
|
||||||
}
|
}
|
||||||
return sort.map((function(_this) {
|
return sort.map((function(_this) {
|
||||||
return function(k, index) {
|
return function(k, index) {
|
||||||
|
@ -70,8 +70,9 @@ WorkStore = assign {},EventEmitter.prototype,{
|
|||||||
|
|
||||||
getData: ({sort,tasks})->
|
getData: ({sort,tasks})->
|
||||||
_tasks = _.clone tasks
|
_tasks = _.clone tasks
|
||||||
for {id} in _list
|
for {id},i in _list when got = _tasks[id]
|
||||||
delete _tasks[id]
|
delete _tasks[id]
|
||||||
|
_list[i] = @itemFromData got,i
|
||||||
sort.map (k,index)=>
|
sort.map (k,index)=>
|
||||||
if _tasks[k]
|
if _tasks[k]
|
||||||
@newItem {item:_tasks[k],index}
|
@newItem {item:_tasks[k],index}
|
||||||
|
Loading…
Reference in New Issue
Block a user