Skip to content

Commit

Permalink
Clear highlighter on seek (#4565)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenl committed Dec 1, 2021
1 parent 035e85a commit 89aa60f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/highlighter/highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// Adapter for using server-side highlighter code.

import { ThreadFront } from "protocol/thread/thread";
import { NodeFront } from "protocol/thread/node";
import { NodeBoundsFront } from "protocol/thread/bounds";
import { BoxModelHighlighter } from "devtools/server/actors/highlighters/box-model";
Expand All @@ -13,6 +14,10 @@ class Highlighter {
currentNode: NodeFront | NodeBoundsFront | null = null;
private timeout: NodeJS.Timeout | undefined;

constructor() {
ThreadFront.on("paused", () => this.unhighlight());
}

async highlight(node: NodeFront | NodeBoundsFront, duration?: number) {
if (!node) {
return;
Expand Down

0 comments on commit 89aa60f

Please sign in to comment.