소스 검색

server : (webui) revert hacky solution from #11626 (#11634)

Xuan-Son Nguyen 11 달 전
부모
커밋
b3451785ac
2개의 변경된 파일3개의 추가작업 그리고 8개의 파일을 삭제
  1. BIN
      examples/server/public/index.html.gz
  2. 3 8
      examples/server/webui/src/main.js

BIN
examples/server/public/index.html.gz


+ 3 - 8
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;