mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Tag Folders: tag filters indicator and show settings
- Add an indicator if any tag filters are applied, so you can see if there are any filters even if the list is collapsed - Save collapse state of the tag list - Fix folders vanishing if tag filters are applied (now really)
This commit is contained in:
@ -116,6 +116,7 @@ export class FilterHelper {
|
||||
}
|
||||
|
||||
const getIsTagged = (entity) => {
|
||||
const isTag = entity.type === 'tag';
|
||||
const tagFlags = selected.map(tagId => this.isElementTagged(entity, tagId));
|
||||
const trueFlags = tagFlags.filter(x => x);
|
||||
const isTagged = TAG_LOGIC_AND ? tagFlags.length === trueFlags.length : trueFlags.length > 0;
|
||||
@ -123,7 +124,9 @@ export class FilterHelper {
|
||||
const excludedTagFlags = excluded.map(tagId => this.isElementTagged(entity, tagId));
|
||||
const isExcluded = excludedTagFlags.includes(true);
|
||||
|
||||
if (isExcluded) {
|
||||
if (isTag) {
|
||||
return true;
|
||||
} else if (isExcluded) {
|
||||
return false;
|
||||
} else if (selected.length > 0 && !isTagged) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user