fix createCache options key

This commit is contained in:
Gabe Yuan
2023-10-07 15:08:10 +08:00
parent 88b791bd73
commit 3e96540b56
2 changed files with 6 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ import {
MSG_TRANS_TOGGLE_STYLE,
MSG_TRANS_GETRULE,
MSG_TRANS_PUTRULE,
APP_LCNAME,
} from "./config";
import {
getSettingWithDefault,
@@ -93,7 +94,7 @@ const init = async () => {
const fab = await getFabWithDefault();
if (!fab.isHide) {
const $action = document.createElement("div");
$action.setAttribute("id", "kiss-translator");
$action.setAttribute("id", APP_LCNAME);
document.body.parentElement.appendChild($action);
const shadowContainer = $action.attachShadow({ mode: "closed" });
const emotionRoot = document.createElement("style");
@@ -101,7 +102,7 @@ const init = async () => {
shadowContainer.appendChild(emotionRoot);
shadowContainer.appendChild(shadowRootElement);
const cache = createCache({
key: "kiss-translator",
key: APP_LCNAME,
prepend: true,
container: emotionRoot,
});

View File

@@ -15,6 +15,7 @@ import {
MSG_TRANS_TOGGLE_STYLE,
MSG_TRANS_GETRULE,
MSG_TRANS_PUTRULE,
APP_LCNAME,
} from "./config";
import { isIframe, sendIframeMsg, sendPrentMsg } from "./libs/iframe";
import { handlePing, injectScript } from "./libs/gm";
@@ -98,7 +99,7 @@ const init = async () => {
// 浮球按钮
const fab = await getFabWithDefault();
const $action = document.createElement("div");
$action.setAttribute("id", "kiss-translator");
$action.setAttribute("id", APP_LCNAME);
document.body.parentElement.appendChild($action);
const shadowContainer = $action.attachShadow({ mode: "closed" });
const emotionRoot = document.createElement("style");
@@ -106,7 +107,7 @@ const init = async () => {
shadowContainer.appendChild(emotionRoot);
shadowContainer.appendChild(shadowRootElement);
const cache = createCache({
key: "kiss-translator",
key: APP_LCNAME,
prepend: true,
container: emotionRoot,
});