summaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastergui/static/js/newcustomimage_modal.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/toaster/toastergui/static/js/newcustomimage_modal.js')
-rw-r--r--lib/toaster/toastergui/static/js/newcustomimage_modal.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/lib/toaster/toastergui/static/js/newcustomimage_modal.js
index 328997af3..98e87f4a6 100644
--- a/lib/toaster/toastergui/static/js/newcustomimage_modal.js
+++ b/lib/toaster/toastergui/static/js/newcustomimage_modal.js
@@ -9,6 +9,8 @@ function newCustomImageModalInit(){
var nameInput = imgCustomModal.find('input');
var invalidMsg = "Image names cannot contain spaces or capital letters. The only allowed special character is dash (-).";
+ var duplicateImageMsg = "An image with this name already exists in this project.";
+ var duplicateRecipeMsg = "A non-image recipe with this name already exists.";
newCustomImgBtn.click(function(e){
e.preventDefault();
@@ -22,8 +24,10 @@ function newCustomImageModalInit(){
console.warn(ret.error);
if (ret.error === "invalid-name") {
showError(invalidMsg);
- } else if (ret.error === "already-exists") {
- showError("An image with this name already exists. Image names must be unique.");
+ } else if (ret.error === "image-already-exists") {
+ showError(duplicateImageMsg);
+ } else if (ret.error === "recipe-already-exists") {
+ showError(duplicateRecipeMsg);
}
} else {
imgCustomModal.modal('hide');