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