Merged in [8377] from rjsparks@nostrum.com:\n Removes a modify-while-iterating error, and removes a bug where two different bits of code thought they were responsible for deleting things from a global list. Fixes bug #1498.
- Legacy-Id: 8388
Note: SVN reference [8377] has been migrated to Git commit a12be8aeb5
This commit is contained in:
commit
e4d43d8e52
|
@ -1009,23 +1009,20 @@ function update_from_slot(session_id, from_slot_id)
|
|||
if(from_slot_id != null && from_scheduledslots != undefined){
|
||||
//console.log("1 from_slot_id", from_slot_id, from_scheduledslots);
|
||||
var count = from_scheduledslots.length;
|
||||
var found = false;
|
||||
var found = [];
|
||||
for(var k = 0; k<from_scheduledslots.length; k++) {
|
||||
var from_ss = from_scheduledslots[k];
|
||||
if(from_ss.session_id == session_id){
|
||||
found = true;
|
||||
|
||||
var promise = from_ss.deleteit();
|
||||
delete_promises.push(promise);
|
||||
from_scheduledslots.splice(k,1);
|
||||
count--;
|
||||
found.push(from_ss)
|
||||
}
|
||||
}
|
||||
if(found && count == 0) {
|
||||
from_timeslot.mark_empty();
|
||||
} else {
|
||||
console.log("not setting fromslot empty", from_timeslot, count, found, session_id, "from_slot_id", from_slot_id);
|
||||
for (var k = 0; k<found.length; k++) {
|
||||
// This will affect agenda_globals.slot_status[from_slot_id], hence from_scheduledslots
|
||||
delete_promises.push(found[k].deleteit());
|
||||
}
|
||||
if (from_scheduledslots.length==0){
|
||||
from_timeslot.mark_empty();
|
||||
}
|
||||
|
||||
/* remove undefined entries */
|
||||
new_fromslots = [];
|
||||
|
|
Loading…
Reference in a new issue