From bc0791b476fc11d824fafe4304eda743371ba9c5 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 8 Jun 2026 16:26:35 +0200 Subject: [PATCH] CustomCommands: fix rename leading to duplicate commands Closes #4283 --- src/plugins/customCommands/CreateTagModal.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/customCommands/CreateTagModal.tsx b/src/plugins/customCommands/CreateTagModal.tsx index 6c39d154a..1a28f28de 100644 --- a/src/plugins/customCommands/CreateTagModal.tsx +++ b/src/plugins/customCommands/CreateTagModal.tsx @@ -11,10 +11,10 @@ import { HeadingSecondary } from "@components/Heading"; import { InfoIcon } from "@components/Icons"; import { Paragraph } from "@components/Paragraph"; import { RenderModalProps } from "@vencord/discord-types"; -import { Modal,openModal, TextArea, TextInput, useState } from "@webpack/common"; +import { Modal, openModal, TextArea, TextInput, useState } from "@webpack/common"; import { parseTagArguments } from "."; -import { addTag, getTag, Tag } from "./settings"; +import { addTag, getTag, removeTag, Tag } from "./settings"; export function openCreateTagModal(initialValue: Tag = { name: "", message: "" }) { openModal(modalProps => ( @@ -55,6 +55,10 @@ function CreateTagDialog({ initialValue, modalProps }: { initialValue: Tag; moda text: isEdit ? "Save" : "Create", variant: "primary", onClick: () => { + if (isEdit && initialValue.name !== name) { + removeTag(initialValue.name); + } + const tag = { name, message }; addTag(tag); modalProps.onClose();