lint and format combined

This commit is contained in:
Xuan Son Nguyen 2025-02-06 11:20:01 +01:00
parent c8dc8d7f55
commit 64c5bbae29
3 changed files with 3 additions and 4 deletions

View file

@ -81,12 +81,11 @@ jobs:
with: with:
node-version: '22.11.0' node-version: '22.11.0'
- name: WebUI - Run lint - name: WebUI - Install dependencies
id: webui_lint id: webui_lint
run: | run: |
cd examples/server/webui cd examples/server/webui
npm ci npm ci
npm run lint
- name: WebUI - Check code format - name: WebUI - Check code format
id: webui_format id: webui_format

View file

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"format": "prettier --write .", "format": "eslint . && prettier --write .",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview" "preview": "vite preview"
}, },

View file

@ -41,7 +41,7 @@ export default function ChatScreen() {
}, [viewingConversation?.id]); }, [viewingConversation?.id]);
const sendNewMessage = async () => { const sendNewMessage = async () => {
if (inputMsg.trim().length === 0) return; if (inputMsg.trim().length === 0 || isGenerating(currConvId)) return;
const convId = viewingConversation?.id ?? StorageUtils.getNewConvId(); const convId = viewingConversation?.id ?? StorageUtils.getNewConvId();
const lastInpMsg = inputMsg; const lastInpMsg = inputMsg;
setInputMsg(''); setInputMsg('');