Skip to content

Commit

Permalink
fix(android): cacheEnabled - make compatible with android sdk-33 (rea…
Browse files Browse the repository at this point in the history
…ct-native-webview#2583)

* fix(android): cacheEnabled - make compatible with android sdk-33

* leftovers
  • Loading branch information
artyorsh authored and oTranThanhNghia committed Sep 14, 2022
1 parent b0442fb commit 5d325c8
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,10 @@ public void setCacheEnabled(WebView view, boolean enabled) {
if (enabled) {
Context ctx = view.getContext();
if (ctx != null) {
view.getSettings().setAppCachePath(ctx.getCacheDir().getAbsolutePath());
view.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
view.getSettings().setAppCacheEnabled(true);
}
} else {
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
view.getSettings().setAppCacheEnabled(false);
}
}

Expand Down Expand Up @@ -604,7 +601,6 @@ public void setIncognito(WebView view, boolean enabled) {

// Disable caching
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
view.getSettings().setAppCacheEnabled(false);
view.clearHistory();
view.clearCache(true);

Expand Down

0 comments on commit 5d325c8

Please sign in to comment.