Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: latency in showing whether a bookmark is added in the toggle button. #3918

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,6 @@ abstract class CoreReaderFragment :
}
updateTableOfContents()
tabsAdapter?.notifyDataSetChanged()
updateUrlProcessor()
updateBottomToolbarArrowsAlpha()
val zimFileReader = zimReaderContainer?.zimFileReader
if (hasValidFileAndUrl(getCurrentWebView()?.url, zimFileReader)) {
Expand Down Expand Up @@ -2150,13 +2149,18 @@ abstract class CoreReaderFragment :

override fun webViewFailedLoading(url: String) {
if (isAdded) {
// If a URL fails to load, update the bookmark toggle.
// This fixes the scenario where the previous page is bookmarked and the next
// page fails to load, ensuring the bookmark toggle is unset correctly.
updateUrlProcessor()
Log.d(TAG_KIWIX, String.format(getString(R.string.error_article_url_not_found), url))
}
}

@Suppress("MagicNumber")
override fun webViewProgressChanged(progress: Int, webView: WebView) {
if (isAdded) {
updateUrlProcessor()
progressBar?.apply {
visibility = View.VISIBLE
show()
Expand Down
Loading