Skip to content

Commit

Permalink
fix: vite env vars for trezor
Browse files Browse the repository at this point in the history
  • Loading branch information
nk1tz authored and bucko13 committed Oct 31, 2023
1 parent 4254f34 commit 85762ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/trezor.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,22 @@ const env_variables = { ...process.env }; // Accessing directly does not appear

const ENV_TREZOR_CONNECT_URL =
env_variables.TREZOR_CONNECT_URL ||
env_variables.REACT_APP_TREZOR_CONNECT_URL;
env_variables.REACT_APP_TREZOR_CONNECT_UR ||
env_variables.VITE_TREZOR_CONNECT_URL;
const ENV_TREZOR_BLOCKBOOK_URL =
env_variables.TREZOR_BLOCKBOOK_URL ||
env_variables.REACT_APP_TREZOR_BLOCKBOOK_URL;
env_variables.REACT_APP_TREZOR_BLOCKBOOK_URL ||
env_variables.VITE_TREZOR_BLOCKBOOK_URL;

const TREZOR_CONNECT_URL =
ENV_TREZOR_CONNECT_URL || `https://${window.location.hostname}:8088/`;
const TREZOR_BLOCKBOOK_URL =
ENV_TREZOR_BLOCKBOOK_URL || `http://${window.location.hostname}:3035/`;

const TREZOR_DEV =
env_variables.TREZOR_DEV || env_variables.REACT_APP_TREZOR_DEV;
env_variables.TREZOR_DEV ||
env_variables.REACT_APP_TREZOR_DEV ||
env_variables.VITE_TREZOR_DEV;
try {
if (TREZOR_DEV)
TrezorConnect.init({
Expand Down

0 comments on commit 85762ee

Please sign in to comment.