textReplace: fix edge case (#1521)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
AutumnVN 2023-08-02 07:28:44 +07:00 committed by GitHub
parent 645749b5ae
commit 0407be9847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);