hide clear cache in userscript

This commit is contained in:
Gabe Yuan
2023-09-06 23:39:11 +08:00
parent 9a2b21eee5
commit b7df44c35a

View File

@@ -11,6 +11,7 @@ import { useSetting } from "../../hooks/Setting";
import { limitNumber } from "../../libs/utils"; import { limitNumber } from "../../libs/utils";
import { useI18n } from "../../hooks/I18n"; import { useI18n } from "../../hooks/I18n";
import { useAlert } from "../../hooks/Alert"; import { useAlert } from "../../hooks/Alert";
import { isExt } from "../../libs/client";
import { import {
UI_LANGS, UI_LANGS,
TRANS_NEWLINE_LENGTH, TRANS_NEWLINE_LENGTH,
@@ -150,23 +151,25 @@ export default function Settings() {
</Select> </Select>
</FormControl> </FormControl>
<FormControl size="small"> {isExt && (
<InputLabel>{i18n("if_clear_cache")}</InputLabel> <FormControl size="small">
<Select <InputLabel>{i18n("if_clear_cache")}</InputLabel>
name="clearCache" <Select
value={clearCache} name="clearCache"
label={i18n("if_clear_cache")} value={clearCache}
onChange={handleChange} label={i18n("if_clear_cache")}
> onChange={handleChange}
<MenuItem value={false}>{i18n("clear_cache_never")}</MenuItem> >
<MenuItem value={true}>{i18n("clear_cache_restart")}</MenuItem> <MenuItem value={false}>{i18n("clear_cache_never")}</MenuItem>
</Select> <MenuItem value={true}>{i18n("clear_cache_restart")}</MenuItem>
<FormHelperText> </Select>
<Link component="button" onClick={handleClearCache}> <FormHelperText>
{i18n("clear_all_cache_now")} <Link component="button" onClick={handleClearCache}>
</Link> {i18n("clear_all_cache_now")}
</FormHelperText> </Link>
</FormControl> </FormHelperText>
</FormControl>
)}
</Stack> </Stack>
</Box> </Box>
); );