diff --git a/README.md b/README.md index bf426e5c..344ea755 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,14 @@ When you want to debug on your local computer, suggest to create .vscode/launch. 3. Go to this public group, and at this time you can get group id from settings. -4. Click `New release` button, to select a latest version to distribute in `release_china` branch. After that, on the `RELEASES` column, you can see a new version on the list as you just add. +4. Click `New release` button, to select a latest version to distribute in `release_china` branch. After that, on the `RELEASES` column, you can see a new version on the list as you just added. -5. Launch our app, it will check the latest build number automatically to update for the first time on android. \ No newline at end of file +5. Launch our app, it will check the latest build number automatically to update for the first time on android. + +There is alternative way to distribute a latest version. + +1. On `Build` menu, select a latest build of `release_china` branch, click `Distribute` to show a dialog on the right of screen. + +2. Click `Click to begin` to select the public group, and then click `Next` button to finish distribution process. + +3. Once distributed, you can check a latest version as you released on the `RELEASES` column of the public group on the `Groups` submenu of `Distribute` menu. \ No newline at end of file diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart index aa47264b..c4775e76 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart @@ -69,7 +69,7 @@ class OpenAppPage extends HookConsumerWidget { onProgressChanged: (controller, progress) async { presenter.changeProgress(progress); }, - signCallback: (params, eip1193, controller) { + signCallback: (params, eip1193, controller) async { final id = params['id']; switch (eip1193) { case EIP1193.requestAccounts: @@ -93,7 +93,11 @@ class OpenAppPage extends HookConsumerWidget { case EIP1193.signTypedMessage: break; case EIP1193.addEthereumChain: - presenter.addEthereumChain(id, params); + bool? result = + await presenter.addEthereumChain(id, params); + if (result != null && result) { + controller!.reload(); + } break; default: break; diff --git a/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart b/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart index 4e6e8ca9..4457b4d9 100644 --- a/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart +++ b/lib/features/dapps/subfeatures/open_dapp/open_dapp_presenter.dart @@ -152,7 +152,8 @@ class OpenDAppPresenter extends CompletePresenter { } } - void addEthereumChain(dynamic id, Map params) { + Future addEthereumChain( + dynamic id, Map params) async { final rawChainId = params["object"]["chainId"] as String; final chainId = Formatter.hexToDecimal(rawChainId); final networks = _chainConfigurationUseCase.networks.value; @@ -161,7 +162,7 @@ class OpenDAppPresenter extends CompletePresenter { if (foundChainIdIndex != -1) { final foundNetwork = networks[foundChainIdIndex]; - showSwitchNetworkDialog(context!, + return await showSwitchNetworkDialog(context!, fromNetwork: state.network!.label ?? state.network!.web3RpcHttpUrl, toNetwork: foundNetwork.label ?? foundNetwork.web3RpcHttpUrl, onTap: () { diff --git a/lib/features/dapps/subfeatures/open_dapp/widgets/bridge_params.dart b/lib/features/dapps/subfeatures/open_dapp/widgets/bridge_params.dart index 8922dcd3..5a670776 100644 --- a/lib/features/dapps/subfeatures/open_dapp/widgets/bridge_params.dart +++ b/lib/features/dapps/subfeatures/open_dapp/widgets/bridge_params.dart @@ -26,8 +26,8 @@ class BridgeParams { String? jsonPrice = json['gasPrice']; gasPrice = jsonPrice == null ? null - : (BigInt.parse(jsonPrice.replaceAll('0x', ''), radix: 16)) - .tokenString(9); + : (int.parse(jsonPrice.replaceAll('0x', ''), radix: 16)) + .toString(); value = BigInt.tryParse((json['value'] ?? '0').replaceAll('0x', ''), radix: 16) ?? diff --git a/lib/features/dapps/subfeatures/open_dapp/widgets/swtich_network_dialog.dart b/lib/features/dapps/subfeatures/open_dapp/widgets/swtich_network_dialog.dart index 7b828f56..20013d50 100644 --- a/lib/features/dapps/subfeatures/open_dapp/widgets/swtich_network_dialog.dart +++ b/lib/features/dapps/subfeatures/open_dapp/widgets/swtich_network_dialog.dart @@ -70,7 +70,7 @@ Future showSwitchNetworkDialog( title: translate('approve'), onTap: () { onTap(); - Navigator.of(context).pop(false); + Navigator.of(context).pop(true); }, size: AxsButtonSize.xl, ),