delete portfolio settings

This commit is contained in:
Justin 2023-03-17 16:50:55 +08:00 committed by GitHub
parent e68401eb51
commit 1ca536dfc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = [];
//}
}
}
});