diff --git a/src-tauri/src/assets/cmd.js b/src-tauri/src/assets/cmd.js index 71c8cfe..186a85e 100644 --- a/src-tauri/src/assets/cmd.js +++ b/src-tauri/src/assets/cmd.js @@ -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) => {