From 5b256bf6ffcd259a74251442f06038e7ce2570bf Mon Sep 17 00:00:00 2001 From: buck Date: Sun, 28 Jan 2024 19:50:47 -0600 Subject: [PATCH] fix(trezor): pin connect url to stable version --- src/trezor.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/trezor.ts b/src/trezor.ts index c522cea..b35a7cc 100644 --- a/src/trezor.ts +++ b/src/trezor.ts @@ -109,21 +109,18 @@ const TREZOR_DEV = env_variables.TREZOR_DEV || env_variables.REACT_APP_TREZOR_DEV || env_variables.VITE_TREZOR_DEV; + try { - if (TREZOR_DEV) - TrezorConnect.init({ - connectSrc: TREZOR_CONNECT_URL, - lazyLoad: true, // this param prevents iframe injection until a TrezorConnect.method is called - manifest: { - email: "help@unchained-capital.com", - appUrl: "https://github.com/unchained-capital/unchained-wallets", - }, - }); - else - TrezorConnect.manifest({ - email: "help@unchained-capital.com", + TrezorConnect.init({ + connectSrc: TREZOR_DEV + ? TREZOR_CONNECT_URL + : "https://connect.trezor.io/9.1.9/", // pinning to this connect version to avoid backwards incompatible changes + lazyLoad: true, // this param prevents iframe injection until a TrezorConnect.method is called + manifest: { + email: "help@unchained.com", appUrl: "https://github.com/unchained-capital/unchained-wallets", - }); + }, + }); } catch (e) { // We hit this if we run this code outside of a browser, for example // during unit testing.