Skip to content

Commit

Permalink
feat: initial offer based on environment config
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx committed Feb 23, 2023
1 parent 0c780a6 commit e05b872
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_APP_SIGNALING_SERVER_BASE_URL=wss://signaling-server-dev.rdx-works-main.extratools.works
VITE_APP_LOG_LEVEL=debug
VITE_APP_LOG_LEVEL=debug
VITE_APP_IS_INITIATOR=true
2 changes: 1 addition & 1 deletion src/chrome/chrome-connector-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ChromeConnectorClient = () => {
source: 'extension',
target: 'wallet',
signalingServerBaseUrl: config.signalingServer.baseUrl,
isInitiator: false,
isInitiator: config.webRTC.isInitiator,
logger,
})

Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const config = {
iceCandidatesBatchTime: 2000,
},
webRTC: {
isInitiator: import.meta.env.VITE_APP_IS_INITIATOR === 'true',
peerConnectionConfig: {
iceServers: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/pairing/pairing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e05b872

Please sign in to comment.