fix clear cache

This commit is contained in:
Gabe Yuan
2023-09-19 12:18:01 +08:00
parent 80782287d8
commit f591d66365

View File

@@ -21,10 +21,10 @@ import {
OPT_LANGS_TO, OPT_LANGS_TO,
OPT_STYLE_ALL, OPT_STYLE_ALL,
OPT_STYLE_USE_COLOR, OPT_STYLE_USE_COLOR,
CACHE_NAME,
} from "../../config"; } from "../../config";
import { sendIframeMsg } from "../../libs/iframe"; import { sendIframeMsg } from "../../libs/iframe";
import { saveRule } from "../../libs/rules"; import { saveRule } from "../../libs/rules";
import { tryClearCaches } from "../../libs";
export default function Popup({ setShowPopup, translator: tran }) { export default function Popup({ setShowPopup, translator: tran }) {
const i18n = useI18n(); const i18n = useI18n();
@@ -71,11 +71,7 @@ export default function Popup({ setShowPopup, translator: tran }) {
}; };
const handleClearCache = () => { const handleClearCache = () => {
try { tryClearCaches();
caches.delete(CACHE_NAME);
} catch (err) {
console.log("[clear cache]", err);
}
}; };
const handleSaveRule = async () => { const handleSaveRule = async () => {