Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DEFAULT_NEWORK in .env.example and use it in settings.ts #210

Merged

Conversation

stormsson
Copy link
Contributor

settings.ts uses snapshot.utils.getSpaceUri without the network parameter;

When running on a network different than mainnet (like rinkeby ) there is no way to pass it here.

  • added DEFAULT_NETWORK param to .env.example to configure the network id to use (example value = 1 to use mainnet to grant retrocompatibility)
  • altered settings.ts to fetch & use env var (with fallback value of "1" to grant retrocompatibility )

@bonustrack @mktcode

.env.example Outdated Show resolved Hide resolved
Copy link
Member

@bonustrack bonustrack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks!

@bonustrack bonustrack merged commit fa64304 into snapshot-labs:master Dec 6, 2021
@mktcode
Copy link
Contributor

mktcode commented Dec 6, 2021

@bonustrack @stormsson

NETWORK

const networkStr = network === 'testnet' ? 'demo.' : '';
proposal.link = `https://${networkStr}snapshot.org/#/${proposal.space.id}/proposal/${proposal.id}`;

SNAPSHOT_URI:

deep_link: `${process.env.SNAPSHOT_URI}/#/${event.space}/${event.id}`

and now there's DEFAULT_NETWORK.

This is a bit confusing but NETWORK could actually be removed and replaced by SNAPSHOT_URI. It does nothing more than building the frontend URL for proposal links and/or push notifications.

@mktcode mktcode mentioned this pull request Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants