Skip to content

Commit 2dc9632

Browse files
committed
🎨 #16126
1 parent 33a76e9 commit 2dc9632

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

app/src/protyle/render/av/filter.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -784,22 +784,29 @@ export const getFiltersHTML = (data: IAV) => {
784784
filterText = ` ${filterText}${dateValue}`;
785785
}
786786
}
787-
} else if (["mSelect", "select"].includes(filterValue.type) && filterValue.mSelect?.length > 0) {
787+
} else if (["mSelect", "select"].includes(filterValue.type)) {
788788
let selectContent = "";
789-
filterValue.mSelect.forEach((item, index) => {
790-
selectContent += item.content;
791-
if (index !== filterValue.mSelect.length - 1) {
792-
selectContent += ", ";
789+
if (filterValue.mSelect?.length > 0) {
790+
filterValue.mSelect.forEach((item, index) => {
791+
selectContent += item.content;
792+
if (index !== filterValue.mSelect.length - 1) {
793+
selectContent += ", ";
794+
}
795+
});
796+
if (selectContent) {
797+
if ("Contains" === filter.operator) {
798+
filterText = `: ${filterText}${selectContent}`;
799+
} else if (filter.operator === "Does not contains") {
800+
filterText = ` ${filterText}${window.siyuan.languages.filterOperatorDoesNotContain} ${selectContent}`;
801+
} else if (filter.operator === "=") {
802+
filterText = `: ${filterText}${selectContent}`;
803+
} else if (filter.operator === "!=") {
804+
filterText = ` ${filterText}${window.siyuan.languages.filterOperatorIsNot} ${selectContent}`;
805+
}
793806
}
794-
});
795-
if ("Contains" === filter.operator) {
796-
filterText = `: ${filterText}${selectContent}`;
797-
} else if (filter.operator === "Does not contains") {
798-
filterText = ` ${filterText}${window.siyuan.languages.filterOperatorDoesNotContain} ${selectContent}`;
799-
} else if (filter.operator === "=") {
800-
filterText = `: ${filterText}${selectContent}`;
801-
} else if (filter.operator === "!=") {
802-
filterText = ` ${filterText}${window.siyuan.languages.filterOperatorIsNot} ${selectContent}`;
807+
}
808+
if (!selectContent && ["rollup", "mAsset"].includes(item.type) && !["Is empty", "Is not empty"].includes(filter.operator)) {
809+
filterText = "";
803810
}
804811
} else if (filterValue.type === "number" && filterValue.number && filterValue.number.isNotEmpty) {
805812
if (["=", "!=", ">", "<"].includes(filter.operator)) {

0 commit comments

Comments
 (0)