Do not reload item description if not needed #5917 (#5918)

Not only that spares resources but it also avoid resetting the web view and its scroll.
This commit is contained in:
Toover 2022-06-03 13:29:49 +02:00 committed by GitHub
parent 89cfeb93db
commit 11b9a1763e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ public class ItemFragment extends Fragment {
}
private void onFragmentLoaded() {
if (webviewData != null) {
if (webviewData != null && !itemsLoaded) {
webvDescription.loadDataWithBaseURL("https://127.0.0.1", webviewData, "text/html", "utf-8", "about:blank");
}
updateAppearance();
@ -420,8 +420,8 @@ public class ItemFragment extends Fragment {
.subscribe(result -> {
progbarLoading.setVisibility(View.GONE);
item = result;
itemsLoaded = true;
onFragmentLoaded();
itemsLoaded = true;
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
}