1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

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;
}
}
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);
},
uid: function (boardId, threadId, uniqueId) {
@ -143,6 +153,16 @@ if (active_page === 'thread' || active_page === 'index') {
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);
}
}