use random eventname

This commit is contained in:
Gabe Yuan
2023-09-02 14:14:27 +08:00
parent 36739f04b3
commit c1bd6a1be6
6 changed files with 26 additions and 12 deletions

View File

@@ -9,7 +9,6 @@ import {
OPT_STYLE_HIGHLIGHT,
OPT_STYLE_DIY,
DEFAULT_COLOR,
EVENT_KISS,
MSG_TRANS_CURRULE,
TRANS_NEWLINE_LENGTH,
} from "../../config";
@@ -112,11 +111,11 @@ export default function Content({ q, translator }) {
};
useEffect(() => {
window.addEventListener(EVENT_KISS, handleKissEvent);
window.addEventListener(translator.eventName, handleKissEvent);
return () => {
window.removeEventListener(EVENT_KISS, handleKissEvent);
window.removeEventListener(translator.eventName, handleKissEvent);
};
}, []);
}, [translator.eventName]);
if (loading) {
return (