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: Play Store reported a crash error when closing the tabs. #3791

Merged
merged 2 commits into from
Apr 17, 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 @@ -1198,6 +1198,10 @@
if (currentTtsWebViewIndex == index) {
onReadAloudStop()
}
// Check if the index is valid; RecyclerView gives the index -1 for already removed views.
// Address those issues when the user frequently clicks on the close icon of the same tab.
// See https://github.com/kiwix/kiwix-android/issues/3790 for more details.
if (index == RecyclerView.NO_POSITION) return
tempZimFileForUndo = zimReaderContainer?.zimFile
tempWebViewForUndo = webViewList[index]
webViewList.removeAt(index)
Expand All @@ -1211,7 +1215,10 @@
snackBarRoot?.let {
it.bringToFront()
Snackbar.make(it, R.string.tab_closed, Snackbar.LENGTH_LONG)
.setAction(R.string.undo) { restoreDeletedTab(index) }.show()
.setAction(R.string.undo) { undoButton ->
undoButton.isEnabled = false
restoreDeletedTab(index)
}.show()

Check warning on line 1221 in core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt#L1218-L1221

Added lines #L1218 - L1221 were not covered by tests
}
openHomeScreen()
}
Expand Down
Loading