Skip to content

Commit bb8b755

Browse files
authored
Merge pull request #1590 from multiversx/override-chain-id-dapp-config
override dapp config chain id from network config
2 parents f60bfd9 + 6ae86f1 commit bb8b755

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/endpoints/dapp-config/dapp.config.service.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ export class DappConfigService {
2222

2323
const networkConfig = await this.gatewayService.getNetworkConfig();
2424
const refreshRate = networkConfig.erd_round_duration;
25+
const chainId = networkConfig.erd_chain_id;
2526

26-
if (refreshRate) {
27-
return {
28-
...this.dappConfig,
29-
refreshRate,
30-
};
27+
const overrides: Partial<DappConfig> = {};
28+
if (refreshRate != null) {
29+
overrides.refreshRate = refreshRate;
30+
}
31+
if (chainId != null) {
32+
overrides.chainId = chainId;
3133
}
3234

33-
return this.dappConfig;
35+
return {
36+
...this.dappConfig,
37+
...overrides,
38+
};
3439
}
3540

3641
getDappConfigurationRaw(): DappConfig | undefined {

0 commit comments

Comments
 (0)