Skip to content

Commit 1623b97

Browse files
committed
change IS_DEV check to allow localhost
1 parent 5899b35 commit 1623b97

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bskyembed/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ In another terminal window, run the snippet dev script:
2323
yarn dev-snippet
2424
```
2525

26-
Then, open `file:/<your files>/social-app/bskyembed/test.html` in your browser.
26+
You can then see the testbed page at http://localhost:5173/test

bskyembed/snippet/embed.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ interface Window {
77
}
88

99
/**
10-
* Allow url to be overwritten during development. `file:` protcol check
11-
* should mean it won't ever get accidentally overridden in production
10+
* Allow url to be overwritten during development
1211
*/
12+
const IS_DEV =
13+
window.location.protocol === 'file:' ||
14+
window.location.hostname === 'localhost'
1315
const EMBED_URL =
14-
window.location.protocol === 'file:' && window.BSKY_DEV_EMBED_URL
16+
IS_DEV && window.BSKY_DEV_EMBED_URL
1517
? window.BSKY_DEV_EMBED_URL
1618
: 'https://embed.bsky.app'
1719

0 commit comments

Comments
 (0)