Skip to content

Commit 5936451

Browse files
committed
[mv3] Fix toggling of "no filtering" as default mode
A bad test prevented the "no filtering" by default mode to not take effect immediately when activated while no site had yet been set to "no filtering". It would however take effect as soon as a specific site would be excluded from "no filtering".
1 parent d7ae3a1 commit 5936451

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

platform/mv3/extension/js/ruleset-manager.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -559,16 +559,17 @@ async function filteringModesToDNR(modes) {
559559
return Promise.all(promises);
560560
}
561561

562-
const isDifferentAllowRules = (a, b) => {
562+
const isDifferentAllowRules = (a = [], b = []) => {
563+
if ( a.length !== b.length ) { return true; }
563564
const pp = [
564565
'requestDomains',
565566
'excludedRequestDomains',
566567
'initiatorDomains',
567568
'excludedInitiatorDomains',
568569
];
569570
for ( const p of pp ) {
570-
const ac = a?.length && a[0].condition[p] || [];
571-
const bc = b?.length && b[0].condition[p] || [];
571+
const ac = a.length && a[0].condition[p] || [];
572+
const bc = b.length && b[0].condition[p] || [];
572573
if ( ac.join() !== bc.join() ) { return true; }
573574
}
574575
return false;

0 commit comments

Comments
 (0)