diff --git a/static/app.js b/static/app.js index 31b9db0..66a133b 100755 --- a/static/app.js +++ b/static/app.js @@ -525,38 +525,20 @@ allFeaturesRemoveBtns.map((value, index) => { for (let i = 0; i < allFeaturesList[index].length; i++) { var item = allFeaturesList[index][i]; console.log(item); - if (item.getAttribute("class") == "active") { - /* - if (item.parentElement.getAttribute("id") == "images-features") { - let getImages = JSON.parse(localStorage.getItem("customImages")); - - let filter = getImages.filter( - (value) => value.fileName !== item.innerText - ); - localStorage.setItem("customImages", JSON.stringify(filter)); - } else if (item.parentElement.getAttribute("id") == "gifs-features") { - let getGifs = JSON.parse(localStorage.getItem("customGifs")); - - let filter = getGifs.filter( - (value) => value.fileName !== item.innerText - ); - localStorage.setItem("customGifs", JSON.stringify(filter)); - } else if ( - item.parentElement.getAttribute("id") == "messages-features" - ) { - let getMsgs = JSON.parse(localStorage.getItem("customMsg")); - - let filter = getMsgs.filter( - (value) => value.messageName !== item.innerText - ); - localStorage.setItem("customMsg", JSON.stringify(filter)); - } - else { - */ + if ((item.getAttribute("class") == "active") && (index == 0 )){ + let symbol = item.innerText; + item.remove(); + uploaded_images = []; + uploaded_GIFs = []; + fetch("/deletePortfolioSettings", { + method: "POST", + body: JSON.stringify(symbol), + }); + } + else if (item.getAttribute("class") == "active") { item.remove(); uploaded_images = []; uploaded_GIFs = []; - //} } } });