fix createCache options key
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
MSG_TRANS_TOGGLE_STYLE,
|
MSG_TRANS_TOGGLE_STYLE,
|
||||||
MSG_TRANS_GETRULE,
|
MSG_TRANS_GETRULE,
|
||||||
MSG_TRANS_PUTRULE,
|
MSG_TRANS_PUTRULE,
|
||||||
|
APP_LCNAME,
|
||||||
} from "./config";
|
} from "./config";
|
||||||
import {
|
import {
|
||||||
getSettingWithDefault,
|
getSettingWithDefault,
|
||||||
@@ -93,7 +94,7 @@ const init = async () => {
|
|||||||
const fab = await getFabWithDefault();
|
const fab = await getFabWithDefault();
|
||||||
if (!fab.isHide) {
|
if (!fab.isHide) {
|
||||||
const $action = document.createElement("div");
|
const $action = document.createElement("div");
|
||||||
$action.setAttribute("id", "kiss-translator");
|
$action.setAttribute("id", APP_LCNAME);
|
||||||
document.body.parentElement.appendChild($action);
|
document.body.parentElement.appendChild($action);
|
||||||
const shadowContainer = $action.attachShadow({ mode: "closed" });
|
const shadowContainer = $action.attachShadow({ mode: "closed" });
|
||||||
const emotionRoot = document.createElement("style");
|
const emotionRoot = document.createElement("style");
|
||||||
@@ -101,7 +102,7 @@ const init = async () => {
|
|||||||
shadowContainer.appendChild(emotionRoot);
|
shadowContainer.appendChild(emotionRoot);
|
||||||
shadowContainer.appendChild(shadowRootElement);
|
shadowContainer.appendChild(shadowRootElement);
|
||||||
const cache = createCache({
|
const cache = createCache({
|
||||||
key: "kiss-translator",
|
key: APP_LCNAME,
|
||||||
prepend: true,
|
prepend: true,
|
||||||
container: emotionRoot,
|
container: emotionRoot,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
MSG_TRANS_TOGGLE_STYLE,
|
MSG_TRANS_TOGGLE_STYLE,
|
||||||
MSG_TRANS_GETRULE,
|
MSG_TRANS_GETRULE,
|
||||||
MSG_TRANS_PUTRULE,
|
MSG_TRANS_PUTRULE,
|
||||||
|
APP_LCNAME,
|
||||||
} from "./config";
|
} from "./config";
|
||||||
import { isIframe, sendIframeMsg, sendPrentMsg } from "./libs/iframe";
|
import { isIframe, sendIframeMsg, sendPrentMsg } from "./libs/iframe";
|
||||||
import { handlePing, injectScript } from "./libs/gm";
|
import { handlePing, injectScript } from "./libs/gm";
|
||||||
@@ -98,7 +99,7 @@ const init = async () => {
|
|||||||
// 浮球按钮
|
// 浮球按钮
|
||||||
const fab = await getFabWithDefault();
|
const fab = await getFabWithDefault();
|
||||||
const $action = document.createElement("div");
|
const $action = document.createElement("div");
|
||||||
$action.setAttribute("id", "kiss-translator");
|
$action.setAttribute("id", APP_LCNAME);
|
||||||
document.body.parentElement.appendChild($action);
|
document.body.parentElement.appendChild($action);
|
||||||
const shadowContainer = $action.attachShadow({ mode: "closed" });
|
const shadowContainer = $action.attachShadow({ mode: "closed" });
|
||||||
const emotionRoot = document.createElement("style");
|
const emotionRoot = document.createElement("style");
|
||||||
@@ -106,7 +107,7 @@ const init = async () => {
|
|||||||
shadowContainer.appendChild(emotionRoot);
|
shadowContainer.appendChild(emotionRoot);
|
||||||
shadowContainer.appendChild(shadowRootElement);
|
shadowContainer.appendChild(shadowRootElement);
|
||||||
const cache = createCache({
|
const cache = createCache({
|
||||||
key: "kiss-translator",
|
key: APP_LCNAME,
|
||||||
prepend: true,
|
prepend: true,
|
||||||
container: emotionRoot,
|
container: emotionRoot,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user