1
0
mirror of https://github.com/lencx/ChatGPT.git synced 2024-10-01 01:06:13 -04:00

feat: the slash command is triggered by the enter key

This commit is contained in:
lencx 2022-12-22 22:09:54 +08:00
parent 39a8d8d297
commit 921d670f53

View File

@ -86,15 +86,11 @@ async function cmdTip() {
return;
}
if (event.keyCode === 32) {
if (event.keyCode === 13 && window.__CHAT_MODEL_CMD__) {
searchInput.value = window.__CHAT_MODEL_CMD__;
modelDom.innerHTML = '';
delete window.__CHAT_MODEL_CMD__;
}
if (event.keyCode === 13) {
modelDom.innerHTML = '';
delete window.__CHAT_MODEL_CMD__;
}
});
searchInput.addEventListener('input', (event) => {