Skip to content

Commit d2596c7

Browse files
author
Jim Pick
authored
Merge pull request #324 from ipfs-shipyard/fix/default-pubsub-name
Add default app name for production
2 parents 687a962 + ff904e2 commit d2596c7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Edit.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,15 @@ class Edit extends Component {
306306

307307
if (!this._backend) {
308308
const peerStarConfig = window.__peerStarConfig ? window.__peerStarConfig : config.peerStar
309+
const defaultAppNames = {
310+
development: 'peer-pad-dev',
311+
production: 'peer-pad/2'
312+
}
313+
const appName = process.env.APP_NAME ||
314+
defaultAppNames[process.env.NODE_ENV]
315+
console.log('peer star app:', appName)
309316
console.log('peer star config:', peerStarConfig)
310-
this._backend = PeerStar(process.env.APP_NAME || 'peer-pad-dev', peerStarConfig)
317+
this._backend = PeerStar(appName, peerStarConfig)
311318
this._backend.on('error', (err) => {
312319
console.error(err)
313320
window.alert(err.message)

0 commit comments

Comments
 (0)