From f591d6636554f0aa6fab0fb64272e61ed7cec9eb Mon Sep 17 00:00:00 2001 From: Gabe Yuan Date: Tue, 19 Sep 2023 12:18:01 +0800 Subject: [PATCH] fix clear cache --- src/views/Popup/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/views/Popup/index.js b/src/views/Popup/index.js index 004c2c7..0c0850d 100644 --- a/src/views/Popup/index.js +++ b/src/views/Popup/index.js @@ -21,10 +21,10 @@ import { OPT_LANGS_TO, OPT_STYLE_ALL, OPT_STYLE_USE_COLOR, - CACHE_NAME, } from "../../config"; import { sendIframeMsg } from "../../libs/iframe"; import { saveRule } from "../../libs/rules"; +import { tryClearCaches } from "../../libs"; export default function Popup({ setShowPopup, translator: tran }) { const i18n = useI18n(); @@ -71,11 +71,7 @@ export default function Popup({ setShowPopup, translator: tran }) { }; const handleClearCache = () => { - try { - caches.delete(CACHE_NAME); - } catch (err) { - console.log("[clear cache]", err); - } + tryClearCaches(); }; const handleSaveRule = async () => {