Skip to content

Commit

Permalink
Merge pull request #17425 from brave/resolve_rewards_anr
Browse files Browse the repository at this point in the history
Resolve rewards ANR with external wallet provider
  • Loading branch information
deeppandya authored Mar 1, 2023
2 parents 943accb + 10f38fe commit 6f0d206
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ public BraveExternalNavigationHandler(ExternalNavigationDelegate delegate) {
@Override
public OverrideUrlLoadingResult shouldOverrideUrlLoading(ExternalNavigationParams params) {
if (isWalletProviderOverride(params)) {
completeWalletProviderVerification(params);
return OverrideUrlLoadingResult.forNavigateTab(params.getUrl(), params);
String originalUrl = params.getUrl().getSpec();
String url = originalUrl.replaceFirst("^rewards://", "brave://rewards/");
GURL browserFallbackGURL = new GURL(url);
if (params.getRedirectHandler() != null) {
params.getRedirectHandler().setShouldNotOverrideUrlLoadingOnCurrentRedirectChain();
}
return OverrideUrlLoadingResult.forNavigateTab(browserFallbackGURL, params);
}
return super.shouldOverrideUrlLoading(params);
}
Expand Down

0 comments on commit 6f0d206

Please sign in to comment.