Skip to content

Commit 159f506

Browse files
committed
feat: modify chainId value in showWalletUI
Signed-off-by: Gaurav Goel <[email protected]>
1 parent c4f88d2 commit 159f506

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/src/main/java/com/web3auth/core/Web3Auth.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,11 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
754754
"defaultChainId",
755755
it.firstOrNull()?.chainId ?: web3AuthOption.defaultChainId ?: "0x1"
756756
)
757+
put(
758+
"chainId",
759+
it.firstOrNull()?.chainId ?: web3AuthOption.defaultChainId ?: "0x1"
760+
)
757761
}
758-
put("chainId", web3AuthOption.defaultChainId ?: "0x1")
759762
projectConfigResponse?.embeddedWalletAuth?.let {
760763
put("embeddedWalletAuth", JSONArray(gson.toJson(it)))
761764
}
@@ -839,10 +842,13 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
839842
put("chains", gson.toJson(it))
840843
put(
841844
"defaultChainId",
842-
web3AuthOption.defaultChainId ?: it.firstOrNull()?.chainId ?: "0x1"
845+
it.firstOrNull()?.chainId ?: web3AuthOption.defaultChainId ?: "0x1"
846+
)
847+
put(
848+
"chainId",
849+
it.firstOrNull()?.chainId ?: web3AuthOption.defaultChainId ?: "0x1"
843850
)
844851
}
845-
put("chainId", web3AuthOption.defaultChainId ?: "0x1")
846852
projectConfigResponse?.embeddedWalletAuth?.let {
847853
initOptions.put("embeddedWalletAuth", JSONArray(gson.toJson(it)))
848854
}

0 commit comments

Comments
 (0)