From 13fcba3d8d68576d6db66b961d8708a27ac7d31a Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Thu, 5 Oct 2023 13:50:16 -0700 Subject: [PATCH 1/2] reassigns value of current_image to new_image when it's a part of a smartstack --- src/store/modules/images.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index d338a217..0eacd96c 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -169,6 +169,7 @@ const actions = { if (response.data.length == 0) { return } + console.log('api: ', apiName + path) const new_image = response.data const recent_images = state.recent_images @@ -197,6 +198,15 @@ const actions = { else { recent_images[old_image_index] = new_image } + // Reassigning value of current_image to new_image + // If a user takes smart stack photos and they select the image as it's updating, + // then the selected image (i.e. the thumbnail with the surrounding yellow border) keeps the yellow border + let current_image = state.current_image + const current_image_SMARTSTK = current_image.header && current_image.header.SMARTSTK + const new_image_SMARTSTK = new_image.header && new_image.header.SMARTSTK + if (current_image_SMARTSTK !== 'no' && current_image_SMARTSTK === new_image_SMARTSTK) { + current_image = new_image + } // We don't have a toggle implemented yet. // But eventually we want one to focus on the new image immediately. From e7c8c9a322c819dfef8a16735ec3d2f221fd2c32 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Thu, 5 Oct 2023 14:38:01 -0700 Subject: [PATCH 2/2] got rid of console.logs --- src/store/modules/images.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 0eacd96c..9bd3001e 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -169,7 +169,6 @@ const actions = { if (response.data.length == 0) { return } - console.log('api: ', apiName + path) const new_image = response.data const recent_images = state.recent_images @@ -204,7 +203,7 @@ const actions = { let current_image = state.current_image const current_image_SMARTSTK = current_image.header && current_image.header.SMARTSTK const new_image_SMARTSTK = new_image.header && new_image.header.SMARTSTK - if (current_image_SMARTSTK !== 'no' && current_image_SMARTSTK === new_image_SMARTSTK) { + if (current_image_SMARTSTK && current_image_SMARTSTK !== 'no' && current_image_SMARTSTK === new_image_SMARTSTK) { current_image = new_image }