From 52a849a0cacfdb0249f2a554e9adb48075418914 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Wed, 14 Feb 2024 21:53:53 +0100 Subject: [PATCH] fix: separate catch block --- src/inpage/inpage.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/inpage/inpage.ts b/src/inpage/inpage.ts index d79e65b2405..f9eb5bf11d8 100644 --- a/src/inpage/inpage.ts +++ b/src/inpage/inpage.ts @@ -305,13 +305,22 @@ try { get: () => warnAboutDeprecatedProvider(provider), set: () => {}, }); +} catch (e) {} + +try { Object.defineProperty(window, 'HiroWalletProvider', { get: () => warnAboutDeprecatedProvider(provider), set: () => {}, }); - Object.defineProperty(window, 'LeatherProvider', { get: () => provider, set: () => {} }); } catch (e) {} +try { + Object.defineProperty(window, 'LeatherProvider', { get: () => provider, set: () => {} }); +} catch (e) { + // eslint-disable-next-line no-console + console.warn('Unable to set LeatherProvider'); +} + // Legacy product provider objects if (typeof window.btc === 'undefined') { (window as any).btc = warnAboutDeprecatedProvider(provider);