From 4c47a6f06b08272505802dd971267da4030a7c76 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 20 Jul 2023 12:21:31 -0400 Subject: [PATCH] fix: ensure we dont add the contentProvider twice by comparing constructor names --- src/webEngine.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/webEngine.ts b/src/webEngine.ts index 9d44743..688e7c3 100644 --- a/src/webEngine.ts +++ b/src/webEngine.ts @@ -167,7 +167,11 @@ export default class WebEngine { } public registerContentProvider(provider: BaseProvider) { - if (this.contentProviders.includes(provider)) { + if ( + this.contentProviders.filter( + (item) => item.constructor.name === provider.constructor.name, + ).length + ) { return; }