Closed simonbyford closed 1 year ago
Previously, the "edit rule" button was broken from page 2 and onwards:
This was happening because it attempts to lookup the rule by id in a sparse array (one padded with many null values). From page 2 and onwards, the array looks something like:
id
null
[ null, null, null, null, null, ... { id: 1, ruleType: "dictionary", pattern: "(c)" ... } ]
So it freaks out when id doesn't exist as a property. We can use optional chaining to avoid this.
Run the rule manager locally, navigate to page 2, and attempt to edit any rule. It should work.
What does this change?
Previously, the "edit rule" button was broken from page 2 and onwards:
This was happening because it attempts to lookup the rule by
id
in a sparse array (one padded with manynull
values). From page 2 and onwards, the array looks something like:So it freaks out when
id
doesn't exist as a property. We can use optional chaining to avoid this.How to test
Run the rule manager locally, navigate to page 2, and attempt to edit any rule. It should work.
Images