]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : (webui) revert hacky solution from #11626 (#11634)
authorXuan-Son Nguyen <redacted>
Mon, 3 Feb 2025 23:10:52 +0000 (00:10 +0100)
committerGitHub <redacted>
Mon, 3 Feb 2025 23:10:52 +0000 (00:10 +0100)
examples/server/public/index.html.gz
examples/server/webui/src/main.js

index df3cb1bef96b805742b458d0abf6c9b16826fae8..e876776e82eeba329b1e808cd46684e32aca94f5 100644 (file)
Binary files a/examples/server/public/index.html.gz and b/examples/server/public/index.html.gz differ
index bc8a6d80f75249eb1394ec7df7e8ae61eb12031f..50197a3552487b2be12d7a9986864443e1e3d05e 100644 (file)
@@ -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;