add clear all rules button

This commit is contained in:
Gabe Yuan
2023-09-08 15:32:42 +08:00
parent d48296046e
commit 07d457be4e
3 changed files with 23 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ import { syncShareRules } from "../../libs/sync";
import { debounce } from "../../libs/utils";
import { delSubRules, getSyncWithDefault } from "../../libs/storage";
import OwSubRule from "./OwSubRule";
import ClearAllIcon from "@mui/icons-material/ClearAll";
function RuleFields({ rule, rules, setShow, setKeyword }) {
const initFormValues = rule || {
@@ -570,6 +571,17 @@ function UserRules({ subRules }) {
selectedUrl={selectedUrl}
/>
<Button
size="small"
variant="outlined"
onClick={() => {
rules.clear();
}}
startIcon={<ClearAllIcon />}
>
{i18n("clear_all")}
</Button>
<HelpButton />
<FormControlLabel