Stop existing detector before creating a new one in startDetector()
Prevents orphaned detector state when load() is called multiple times. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -255,6 +255,9 @@ export class CookieBannerClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.detector) {
|
||||||
|
this.detector.stop();
|
||||||
|
}
|
||||||
this.detector = new CookieDetector(this.baseUrl, this.bannerId, knownNames);
|
this.detector = new CookieDetector(this.baseUrl, this.bannerId, knownNames);
|
||||||
this.detector.start();
|
this.detector.start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user