if (formatTagName !== "no filter, currently showing all tags" && dataMatch) {
// Modify the 'bannedPromptPhrases' array
dataObj.bannedPromptPhrases = [`/^(?!.*(\\b${formatTagName}\\b)).*$/i`];
localStorage.setItem("lookForThis", formatTagName);
} else {
localStorage.removeItem("lookForThis");
}
if (formatBadTags !== "no bad words to filter") {
dataObj.bannedPromptPhrases.push(...formatBadTags);
let badTagsJoin = formatBadTags.join(', ')
localStorage.setItem("dontLookForThis", badTagsJoin);
} else {
localStorage.removeItem("dontLookForThis")
}
I want to add my own banned list [jail.bannedPromptPhrases] and import jail, added after that as
if (Array.isArray(jail?.bannedPromptPhrases)) {
dataObj.bannedPromptPhrases.push(...jail.bannedPromptPhrases);
}
}
I dont know if this is really the problem because i was testing using my own pics, but i forgot that i can still see my pics when they are banned if i am with admin mode disabled.
But make sure your list is an array:
let furryJail = jail.bannedPromptPhrases.selectAll.join(','); furryJail .split(",") .map(tag => tag.trim()) .filter(tag => tag !== "") ; dataObj.bannedPromptPhrases.push(...furryJail);
like
also you need to add it in 2 functions, changeAll() and changeGallerySubChannel() so it runs at the start.
The problem is the condition, that list is not an array, I'm pretty sure it is an object. An object is something like "BannedPromptPhrases = {banWord1: "banWord1", banWord2: "banWord2"}; They are values stored inside the var. So the commands below (join() split() map() filter()) converts it to an array, the condition should be AFTER. But i think you don't need that condition, and if you are lazy just change it to something that's always true like 2===2.