Skip to content

Commit

Permalink
Merge pull request #29 from guardian/jsh/no-debug-ranges
Browse files Browse the repository at this point in the history
Don't add debug decorations on error unless debug is enabled
  • Loading branch information
jonathonherbert committed Jan 27, 2019
2 parents 52af2d9 + d0a3cdd commit 3487a4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ts/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ const handleValidationRequestError = <
// validated on the next pass.
let decorations = state.decorations.remove(decsToRemove);

if (dirtiedRanges.length) {
if (dirtiedRanges.length && state.debug) {
decorations = decorations.add(
tr.doc,
dirtiedRanges.map(range => createDebugDecorationFromRange(range))
Expand Down
4 changes: 1 addition & 3 deletions src/ts/test/state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ describe("State management", () => {
to: 25
}
],
decorations: new DecorationSet().add(initialDocToValidate, [
createDebugDecorationFromRange({ from: 1, to: 25 })
]),
decorations: new DecorationSet(),
error: "Too many requests",
validationInFlight: undefined
});
Expand Down

0 comments on commit 3487a4e

Please sign in to comment.