refactor: Hide Clash Field Option when Disable Filter (#63)

This commit is contained in:
Pylogmon
2023-12-05 08:34:57 +08:00
committed by GitHub
parent 7ced009e92
commit 7534f8fc37
2 changed files with 19 additions and 13 deletions

View File

@@ -38,7 +38,11 @@ const SettingClash = ({ onError }: Props) => {
const { ipv6, "allow-lan": allowLan, "log-level": logLevel } = clash ?? {};
const { enable_random_port = false, verge_mixed_port } = verge ?? {};
const {
enable_random_port = false,
verge_mixed_port,
enable_clash_fields = false,
} = verge ?? {};
const webRef = useRef<DialogRef>(null);
const fieldRef = useRef<DialogRef>(null);
@@ -162,16 +166,18 @@ const SettingClash = ({ onError }: Props) => {
</IconButton>
</SettingItem>
<SettingItem label={t("Clash Field")}>
<IconButton
color="inherit"
size="small"
sx={{ my: "2px" }}
onClick={() => fieldRef.current?.open()}
>
<ArrowForward />
</IconButton>
</SettingItem>
{enable_clash_fields && (
<SettingItem label={t("Clash Field")}>
<IconButton
color="inherit"
size="small"
sx={{ my: "2px" }}
onClick={() => fieldRef.current?.open()}
>
<ArrowForward />
</IconButton>
</SettingItem>
)}
<SettingItem
label={t("Clash Core")}