@manifoldxyz/frontend-provider-utils
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -42,2 +42,7 @@ "use strict"; | ||
}); | ||
if (!initialized) { | ||
window.addEventListener(frontend_provider_types_1.MANIFOLD_ETHEREUM_EXISTS, handleManifoldEthereum, { | ||
once: true, | ||
}); | ||
} | ||
// Poll for provider (legacy clients that do not emit event) | ||
@@ -63,2 +68,5 @@ var intervalId_1 = setInterval(function () { | ||
window.removeEventListener(frontend_provider_types_1.MANIFOLD_ETHEREUM_INITIALIZED, handleManifoldEthereum); | ||
if (!initialized) { | ||
window.removeEventListener(frontend_provider_types_1.MANIFOLD_ETHEREUM_EXISTS, handleManifoldEthereum); | ||
} | ||
if (providerInitialized()) { | ||
@@ -65,0 +73,0 @@ resolve(window.ManifoldEthereumProvider); |
{ | ||
"name": "@manifoldxyz/frontend-provider-utils", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.3", | ||
"description": "A tiny utility for detecting the Manifold Ethereum provider, an injected `window.ManifoldEthereumProvider` object", | ||
@@ -5,0 +5,0 @@ "typings": "./dist/index.d.ts", |
import { | ||
EthereumProvider, | ||
MANIFOLD_ETHEREUM_EXISTS, | ||
MANIFOLD_ETHEREUM_INITIALIZED, | ||
@@ -54,2 +55,7 @@ } from '@manifoldxyz/frontend-provider-types'; | ||
}); | ||
if (!initialized) { | ||
window.addEventListener(MANIFOLD_ETHEREUM_EXISTS, handleManifoldEthereum, { | ||
once: true, | ||
}); | ||
} | ||
@@ -78,2 +84,5 @@ // Poll for provider (legacy clients that do not emit event) | ||
window.removeEventListener(MANIFOLD_ETHEREUM_INITIALIZED, handleManifoldEthereum); | ||
if (!initialized) { | ||
window.removeEventListener(MANIFOLD_ETHEREUM_EXISTS, handleManifoldEthereum); | ||
} | ||
@@ -80,0 +89,0 @@ if (providerInitialized()) { |
18954
347