From: Xuan-Son Nguyen Date: Mon, 3 Feb 2025 23:10:52 +0000 (+0100) Subject: server : (webui) revert hacky solution from #11626 (#11634) X-Git-Tag: upstream/0.0.4631~4 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=b3451785aca16fbf4214eeba7e4612676cdf8ccb;p=pkg%2Fggml%2Fsources%2Fllama.cpp server : (webui) revert hacky solution from #11626 (#11634) --- diff --git a/examples/server/public/index.html.gz b/examples/server/public/index.html.gz index df3cb1be..e876776e 100644 Binary files a/examples/server/public/index.html.gz and b/examples/server/public/index.html.gz differ diff --git a/examples/server/webui/src/main.js b/examples/server/webui/src/main.js index bc8a6d80..50197a35 100644 --- a/examples/server/webui/src/main.js +++ b/examples/server/webui/src/main.js @@ -468,14 +468,9 @@ const mainApp = createApp({ URL.revokeObjectURL(url); }, async sendMessage() { - if (!this.inputMsg) return; - - if (this.isGenerating) { - this.stopGeneration(); - while (this.isGenerating) { - await new Promise((resolve) => setTimeout(resolve, 10)); - } - } + // prevent sending empty message + // also allow typing the message while generating, but does not allow sending it (to match UX/UI behavior of other chat apps) + if (!this.inputMsg || this.isGenerating) return; const currConvId = this.viewingConvId;