mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 03:45:33 -04:00
Merge pull request #3763 from kiwix/Fix#3762
Fixed: Opening ZIM file from history that does not exist in fileSystem leads to execpected UI behavior (When already a ZIM file opened in the reader).
This commit is contained in:
commit
c439e304b0
@ -113,6 +113,12 @@ class KiwixReaderFragment : CoreReaderFragment() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (filePath == null || !File(filePath).isFileExist()) {
|
if (filePath == null || !File(filePath).isFileExist()) {
|
||||||
|
// Close the previously opened book in the reader. Since this file is not found,
|
||||||
|
// it will not be set in the zimFileReader. The previously opened ZIM file
|
||||||
|
// will be saved when we move between fragments. If we return to the reader again,
|
||||||
|
// it will attempt to open the last opened ZIM file with the last loaded URL,
|
||||||
|
// which is inside the non-existing ZIM file. This leads to unexpected behavior.
|
||||||
|
exitBook()
|
||||||
activity.toast(R.string.error_file_not_found)
|
activity.toast(R.string.error_file_not_found)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user