Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Jan 9, 2024
1 parent 434f307 commit e896382
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NETWORK=stokenet # Options: mainnet or stokenet
DAPP_DEFINITION=account_tdx_2_129kev9w27tsl7qjg0dlyze70kxnlzycs8v2c85kzec40gg8mt73f7y
DAPP_DEFINITION_ADDRESS=account_tdx_2_129kev9w27tsl7qjg0dlyze70kxnlzycs8v2c85kzec40gg8mt73f7y
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const nextConfig = {
reactStrictMode: false,

pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
env: {
NETWORK: process.env.NETWORK,
DAPP_DEFINITION_ADDRESS: process.env.DAPP_DEFINITION_ADDRESS,
},
};

module.exports = withMDX(nextConfig);
15 changes: 12 additions & 3 deletions src/app/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function initializeSubscriptions(store: AppStore) {
default:
networkId = RadixNetwork.Stokenet;
}

rdtInstance = RadixDappToolkit({
dAppDefinitionAddress: process.env.DAPP_DEFINITION_ADDRESS
? process.env.DAPP_DEFINITION_ADDRESS
Expand All @@ -61,9 +60,19 @@ export function initializeSubscriptions(store: AppStore) {
setRdt(rdtInstance);
// TODO: "black" on the light theme
rdtInstance.buttonApi.setTheme("white");
const network: string = process.env.NETWORK || "stokenet";
let network;
switch (process.env.NETWORK) {
case "mainnet":
network = adex.ApiNetworkOptions.indexOf("mainnet");
break;
case "stokenet":
network = adex.ApiNetworkOptions.indexOf("stokenet");
break;
default:
network = adex.ApiNetworkOptions.indexOf("stokenet");
}

adex.init(adex.ApiNetworkOptions[network as any]);
adex.init(adex.ApiNetworkOptions[network]);
subs.push(
adex.clientState.stateChanged$.subscribe((newState) => {
const serializedState: adex.StaticState = JSON.parse(
Expand Down

0 comments on commit e896382

Please sign in to comment.