Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fix: Removed refresh for all dapps
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed Sep 12, 2023
1 parent 11af80b commit 4a8de38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
15 changes: 7 additions & 8 deletions lib/features/dapps/subfeatures/open_dapp/open_dapp_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ class OpenAppPage extends HookConsumerWidget {
case EIP1193.addEthereumChain:
bool? result =
await presenter.addEthereumChain(id, params);
final isL3Bridge =
Config.reloadDapp.any((e) => url.contains(e));
if (isL3Bridge) {
if (result != null && result) {
controller!.reload();
}
}

// final isL3Bridge =
// Config.reloadDapp.any((e) => url.contains(e));
// if (isL3Bridge) {
// if (result != null && result) {
// controller!.reload();
// }
// }
break;
default:
break;
Expand Down
22 changes: 11 additions & 11 deletions packages/web3_provider/lib/inapp_webview_eip1193.dart
Original file line number Diff line number Diff line change
Expand Up @@ -956,17 +956,17 @@ class _InAppWebViewEIP1193State extends State<InAppWebViewEIP1193> {
onConsoleMessage: widget.onConsoleMessage,
onProgressChanged: (controller, progress) async {
widget.onProgressChanged?.call(controller, progress);
final url = await controller.getUrl();
final isL3Bridge =
Config.reloadDapp.any((e) => e.contains(url!.host));
if (isL3Bridge) {
await _webViewController?.evaluateJavascript(
source: jsProviderScript ?? '',
);
await _webViewController?.evaluateJavascript(
source: _getFunctionInject(),
);
}
// final url = await controller.getUrl();
// final isL3Bridge =
// Config.reloadDapp.any((e) => e.contains(url!.host));
// if (isL3Bridge) {
// await _webViewController?.evaluateJavascript(
// source: jsProviderScript ?? '',
// );
// await _webViewController?.evaluateJavascript(
// source: _getFunctionInject(),
// );
// }
},
shouldOverrideUrlLoading: widget.shouldOverrideUrlLoading,
onLoadResource: widget.onLoadResource,
Expand Down

0 comments on commit 4a8de38

Please sign in to comment.