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:
Émile Ré
2026-04-22 17:34:47 +04:00
parent 137b63a47e
commit d5d77fee8a

View File

@@ -255,6 +255,9 @@ export class CookieBannerClient {
}
}
if (this.detector) {
this.detector.stop();
}
this.detector = new CookieDetector(this.baseUrl, this.bannerId, knownNames);
this.detector.start();
}