Browse Source

Fix crash when deleting a lonely image

master
Hardcore Sushi 2 months ago
parent
commit
a4db2740a1
Signed by: hardcoresushi GPG Key ID: 007F84120107191E
  1. 3
      app/src/main/java/sushi/hardcore/droidfs/file_viewers/ImageViewer.kt

3
app/src/main/java/sushi/hardcore/droidfs/file_viewers/ImageViewer.kt

@ -119,7 +119,8 @@ class ImageViewer: FileViewerActivity() {
.keepFullScreen()
.setTitle(R.string.warning)
.setPositiveButton(R.string.ok) { _, _ ->
if (gocryptfsVolume.removeFile(filePath)){
createPlaylist() //be sure the playlist is created before deleting if there is only one image
if (gocryptfsVolume.removeFile(filePath)) {
playlistNext(true)
refreshPlaylist()
if (mappedPlaylist.size == 0) { //deleted all images of the playlist

Loading…
Cancel
Save