Skip to content

Commit

Permalink
BrowserStack local iOS testing compatibility
Browse files Browse the repository at this point in the history
On iOS, BrowserStack routes localhost connections for testing of local code
through an actual domain (bs-local.com) because iOS blocks localhost connections
to content that's not sitting on the phone.
This commit adds changes to treat bs-local.com just like localhost, such that
a locally served dev server can be tested with BrowserStack.
  • Loading branch information
danimoh committed Dec 12, 2022
1 parent 7a25d0b commit 50b5378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config/config.local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
apiEndpoint: window.sessionStorage['use-local-kyc-server'] // switch that can be set to use local kyc server
// Note that locally signed grants are not actually eligible for higher limits on the deployed Fastspot and
// OASIS test instances because they don't exist in the deployed TEN31 Pass's database.
? 'http://localhost:8082'
? `http://${window.location.hostname}:8082`
: 'https://test.pass.ten31.com',
appId: window.location.protocol === 'https:'
? 'ecf6f03e-7af0-4af8-a4a8-c3a8cc16e168'
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const ENV_TEST = 'test';
export const ENV_DEV = 'dev';

export const MAINNET_ORIGIN = 'https://wallet.nimiq.com';
export const TESTNET_ORIGIN = window.location.hostname === 'localhost'
? 'http://localhost:8081'
export const TESTNET_ORIGIN = window.location.hostname === 'localhost' || window.location.hostname === 'bs-local.com'
? `${window.location.protocol}//${window.location.hostname}:8081`
: 'https://wallet.nimiq-testnet.com';

export const FIAT_CURRENCY_DENYLIST = [
Expand Down

0 comments on commit 50b5378

Please sign in to comment.