1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

fix tests

This commit is contained in:
Michael Telatynski
2021-06-15 10:15:43 +01:00
parent e0c36498e6
commit eb5908d5d2

View File

@@ -102,26 +102,21 @@ export class FilterComponent {
const name = Object.keys(literalKeys)[n];
const matchFunc = literalKeys[name];
const notName = "not_" + name;
const disallowedValues = this[notName];
if (disallowedValues.filter(matchFunc).length > 0) {
const disallowedValues: string[] = this.filterJson[notName];
if (disallowedValues?.some(matchFunc)) {
return false;
}
const allowedValues = this[name];
if (allowedValues && allowedValues.length > 0) {
const anyMatch = allowedValues.some(matchFunc);
if (!anyMatch) {
const allowedValues: string[] = this.filterJson[name];
if (allowedValues && !allowedValues.some(matchFunc)) {
return false;
}
}
}
const containsUrlFilter = this.filterJson.contains_url;
if (containsUrlFilter !== undefined) {
if (containsUrlFilter !== containsUrl) {
if (containsUrlFilter !== undefined && containsUrlFilter !== containsUrl) {
return false;
}
}
return true;
}