mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-18 06:00:18 +08:00
added a no tag filter
This commit is contained in:
parent
7ba00ff11e
commit
3ffe7ddde4
1 changed files with 8 additions and 7 deletions
|
|
@ -328,10 +328,10 @@ function updateFilterTags(){
|
|||
$(".pageAccount .content .filterButtons .buttons.tags").empty();
|
||||
if(dbSnapshot.tags.length > 0){
|
||||
$(".pageAccount .content .filterButtons .buttonsAndTitle.tags").removeClass('hidden');
|
||||
if(config.resultFilters.includes("tag_all")){
|
||||
$(".pageAccount .content .filterButtons .buttons.tags").append(`<div class="button active" filter="tag_all">all</div>`);
|
||||
if(config.resultFilters.includes("tag_notag")){
|
||||
$(".pageAccount .content .filterButtons .buttons.tags").append(`<div class="button active" filter="tag_notag">no tag</div>`);
|
||||
}else{
|
||||
$(".pageAccount .content .filterButtons .buttons.tags").append(`<div class="button" filter="tag_all">all</div>`);
|
||||
$(".pageAccount .content .filterButtons .buttons.tags").append(`<div class="button" filter="tag_notag">no tag</div>`);
|
||||
}
|
||||
dbSnapshot.tags.forEach(tag => {
|
||||
if(config.resultFilters.includes("tag_"+tag.name)){
|
||||
|
|
@ -580,16 +580,17 @@ function refreshAccountPage() {
|
|||
}
|
||||
if(!activeFilters.includes(puncfilter)) return;
|
||||
|
||||
try{
|
||||
if(!activeFilters.includes("tag_all") && dbSnapshot.tags.length > 0){
|
||||
if(dbSnapshot.tags.length > 0){
|
||||
if(result.tags !== undefined && result.tags.length > 0){
|
||||
|
||||
let found = false;
|
||||
result.tags.forEach(tag => {
|
||||
if(activeFilters.includes("tag_"+tag)) found = true;
|
||||
})
|
||||
if(!found) return;
|
||||
}else{
|
||||
if(!activeFilters.includes("tag_notag")) return;
|
||||
}
|
||||
}catch(e){
|
||||
if(!activeFilters.includes("tag_all") && dbSnapshot.tags.length > 0) return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue