From 0407be98477e90b3693827f4e1df6df857053009 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 2 Aug 2023 07:28:44 +0700 Subject: [PATCH] textReplace: fix edge case (#1521) Co-authored-by: V --- src/plugins/textReplace.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/textReplace.tsx b/src/plugins/textReplace.tsx index e1611682..1e8aca7b 100644 --- a/src/plugins/textReplace.tsx +++ b/src/plugins/textReplace.tsx @@ -123,6 +123,7 @@ function TextReplace({ title, rulesArray, rulesKey, update }: TextReplaceProps) const isRegexRules = title === "Using Regex"; async function onClickRemove(index: number) { + if (index === rulesArray.length - 1) return; rulesArray.splice(index, 1); await DataStore.set(rulesKey, rulesArray);