Clear empty thread/board from filter list

This commit is contained in:
marktaiwan 2015-02-18 14:03:06 +08:00 committed by czaks
parent 2808b1b8b2
commit 709a248d10

View File

@ -127,6 +127,16 @@ if (active_page === 'thread' || active_page === 'index') {
break; break;
} }
} }
if ($.isEmptyObject(filter[boardId][threadId])) {
delete filter[boardId][threadId];
delete list.nextPurge[boardId][threadId];
if ($.isEmptyObject(filter[boardId])) {
delete filter[boardId];
delete list.nextPurge[boardId];
}
}
setList(list); setList(list);
}, },
uid: function (boardId, threadId, uniqueId) { uid: function (boardId, threadId, uniqueId) {
@ -143,6 +153,16 @@ if (active_page === 'thread' || active_page === 'index') {
break; break;
} }
} }
if ($.isEmptyObject(filter[boardId][threadId])) {
delete filter[boardId][threadId];
delete list.nextPurge[boardId][threadId];
if ($.isEmptyObject(filter[boardId])) {
delete filter[boardId];
delete list.nextPurge[boardId];
}
}
setList(list); setList(list);
} }
} }