From 84c37b9b35ddeed9d30653eae87cfaab40b26ef4 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 6 Mar 2016 16:40:40 +0100 Subject: [PATCH] Fixed error when deleting last open photo in album --- src/scripts/photo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scripts/photo.js b/src/scripts/photo.js index 92bd026..34e4d1c 100644 --- a/src/scripts/photo.js +++ b/src/scripts/photo.js @@ -192,8 +192,8 @@ photo.delete = function(photoIDs) { action.fn = function() { - let nextPhoto - let previousPhoto + let nextPhoto = null + let previousPhoto = null basicModal.close() @@ -219,8 +219,8 @@ photo.delete = function(photoIDs) { // Go to next photo if there is a next photo and // next photo is not the current one. Show album otherwise. - if (visible.photo() && nextPhoto!=='' && nextPhoto!==photo.getID()) lychee.goto(album.getID() + '/' + nextPhoto) - else if (!visible.albums()) lychee.goto(album.getID()) + if (visible.photo() && nextPhoto!=null && nextPhoto!==photo.getID()) lychee.goto(album.getID() + '/' + nextPhoto) + else if (!visible.albums()) lychee.goto(album.getID()) let params = { photoIDs: photoIDs.join()