Skip to content

Commit

Permalink
Don't abort client init when GenesisConfig is already initialized
Browse files Browse the repository at this point in the history
This way one can initialize the GenesisConfig for mainnet before starting the client, and then use the demo page to connect to the mainnet.
  • Loading branch information
sisou committed Jul 25, 2024
1 parent 44d70ef commit e24de9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@
nimiqInitPromise.then(async () => {
document.getElementById('message').innerText = 'Nimiq loaded. Connecting and establishing consensus.';

// Connect to the testnet.
Nimiq.GenesisConfig.test();
try {
// Try to connect to the testnet.
Nimiq.GenesisConfig.test();
} catch (error) {
console.error(error);
// Don't fail if GenesisConfig has already been initialized (e.g. for mainnet).
}

const $ = {};
window.$ = $;
Expand Down

0 comments on commit e24de9a

Please sign in to comment.