mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
add close shortkey
This commit is contained in:
parent
9142cd3303
commit
969558a126
@ -1563,7 +1563,7 @@ function _Chat() {
|
|||||||
// 展示快捷键 command + /
|
// 展示快捷键 command + /
|
||||||
else if ((event.metaKey || event.ctrlKey) && event.key === "/") {
|
else if ((event.metaKey || event.ctrlKey) && event.key === "/") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setShowShortcutKeyModal(true);
|
setShowShortcutKeyModal(!showShortcutKeyModal);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1572,7 +1572,7 @@ function _Chat() {
|
|||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener("keydown", handleKeyDown);
|
window.removeEventListener("keydown", handleKeyDown);
|
||||||
};
|
};
|
||||||
}, [messages, chatStore, navigate]);
|
}, [messages, chatStore, navigate, showShortcutKeyModal]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.chat} key={session.id}>
|
<div className={styles.chat} key={session.id}>
|
||||||
|
@ -85,7 +85,9 @@ merge(fallbackLang, targetLang);
|
|||||||
export default fallbackLang as LocaleType;
|
export default fallbackLang as LocaleType;
|
||||||
|
|
||||||
function getItem(key: string) {
|
function getItem(key: string) {
|
||||||
|
if (typeof window !== "undefined") {
|
||||||
return localStorage.getItem(key);
|
return localStorage.getItem(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setItem(key: string, value: string) {
|
function setItem(key: string, value: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user