fix: ensure we dont add the contentProvider twice by comparing constructor names

This commit is contained in:
Derrick Hammer 2023-07-20 12:21:31 -04:00
parent 8b581ee98e
commit 4c47a6f06b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}