You've already forked matrix-js-sdk
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user