Skip to content

Commit

Permalink
Images: bug fix for image not found right away on Web after adding image
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicagood committed Aug 8, 2018
1 parent 10a0af6 commit 9412e74
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions www/app/spot/images/image.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@
if (image.height === currentImageData.height && image.width === currentImageData.width) {
saveImage(image.src).then(function () {
$log.log('Also save image to live db here');
LiveDBFactory.saveImageFile(currentImageData.id, image.src);
$rootScope.$broadcast('updatedImages');
isReattachImage = false;
$ionicPopup.alert({
'title': 'Finished Reattaching Image',
'template': 'The selected image source was reattached to the selected image properties.'
LiveDBFactory.saveImageFile(currentImageData.id, image.src).then(function() {
$rootScope.$broadcast('updatedImages');
isReattachImage = false;
$ionicPopup.alert({
'title': 'Finished Reattaching Image',
'template': 'The selected image source was reattached to the selected image properties.'
});
});
});
}
Expand All @@ -152,8 +153,9 @@
});
saveImage(image.src);
$log.log('Also save image to live db here');
LiveDBFactory.saveImageFile(currentImageData.id, image.src);
saveImageDataToSpot();
LiveDBFactory.saveImageFile(currentImageData.id, image.src).then(function () {
saveImageDataToSpot();
});
}
};
image.onerror = function () {
Expand Down

0 comments on commit 9412e74

Please sign in to comment.