Skip to content
This repository has been archived by the owner on Feb 16, 2025. It is now read-only.

fix: vite env vars for trezor #130

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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