From e05b872bea0ceb09d8167e844bd782d15da54d66 Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Thu, 23 Feb 2023 13:26:51 +0100 Subject: [PATCH] feat: initial offer based on environment config --- .env.development | 3 ++- src/chrome/chrome-connector-client.ts | 2 +- src/config.ts | 1 + src/pairing/pairing.tsx | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 5866f384..1fb9d88d 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ VITE_APP_SIGNALING_SERVER_BASE_URL=wss://signaling-server-dev.rdx-works-main.extratools.works -VITE_APP_LOG_LEVEL=debug \ No newline at end of file +VITE_APP_LOG_LEVEL=debug +VITE_APP_IS_INITIATOR=true \ No newline at end of file diff --git a/src/chrome/chrome-connector-client.ts b/src/chrome/chrome-connector-client.ts index debdb6ca..c8f9fcfa 100644 --- a/src/chrome/chrome-connector-client.ts +++ b/src/chrome/chrome-connector-client.ts @@ -28,7 +28,7 @@ export const ChromeConnectorClient = () => { source: 'extension', target: 'wallet', signalingServerBaseUrl: config.signalingServer.baseUrl, - isInitiator: false, + isInitiator: config.webRTC.isInitiator, logger, }) diff --git a/src/config.ts b/src/config.ts index d9a2fbf6..2cff6a10 100644 --- a/src/config.ts +++ b/src/config.ts @@ -63,6 +63,7 @@ export const config = { iceCandidatesBatchTime: 2000, }, webRTC: { + isInitiator: import.meta.env.VITE_APP_IS_INITIATOR === 'true', peerConnectionConfig: { iceServers: [ { diff --git a/src/pairing/pairing.tsx b/src/pairing/pairing.tsx index e60d6625..b60f2b98 100644 --- a/src/pairing/pairing.tsx +++ b/src/pairing/pairing.tsx @@ -21,7 +21,7 @@ export const Paring = () => { source: 'extension', target: 'wallet', signalingServerBaseUrl: config.signalingServer.baseUrl, - isInitiator: false, + isInitiator: config.webRTC.isInitiator, logger: new Logger({ prettyLogTemplate: '{{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}\t', minLevel: 2,