From 65d00fe6167e87ab64cf3996036d6895b1792e6f Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Wed, 22 Jan 2025 18:42:08 +0530 Subject: [PATCH] Fixed the scenario where, if the application does not have the MANAGE_EXTERNAL_STORAGE permission and the user tries to open a ZIM file from the file manager, the app now prompts for the required permission instead of showing an error. --- .../nav/destination/library/LocalLibraryFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt index a182bde18..61a82685f 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt @@ -437,7 +437,9 @@ class LocalLibraryFragment : BaseFragment(), CopyMoveFileHandler.FileCopyMoveCal ) } else { zimFileUri = uri - if (requestExternalStorageWritePermission()) { + if (!requireActivity().isManageExternalStoragePermissionGranted(sharedPreferenceUtil)) { + showManageExternalStoragePermissionDialog() + } else if (requestExternalStorageWritePermission()) { getZimFileFromUri(uri)?.let(::navigateToReaderFragment) } }