Browse Source

enh: disable edit button during generation

Timothy Jaeryang Baek 2 months ago
parent
commit
2db9d6b5d2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/lib/components/notes/NoteEditor/Chat.svelte

+ 2 - 1
src/lib/components/notes/NoteEditor/Chat.svelte

@@ -403,10 +403,11 @@ Based on the user's instruction, update and enhance the existing notes or select
 
 											localStorage.setItem('noteEditEnabled', editEnabled ? 'true' : 'false');
 										}}
+										disabled={streaming || loading}
 										type="button"
 										class="px-2 @xl:px-2.5 py-2 flex gap-1.5 items-center text-sm rounded-full transition-colors duration-300 focus:outline-hidden max-w-full overflow-hidden hover:bg-gray-50 dark:hover:bg-gray-800 {editEnabled
 											? ' text-sky-500 dark:text-sky-300 bg-sky-50 dark:bg-sky-200/5'
-											: 'bg-transparent text-gray-600 dark:text-gray-300 '}"
+											: 'bg-transparent text-gray-600 dark:text-gray-300 '} disabled:opacity-50 disabled:pointer-events-none"
 									>
 										<PencilSquare className="size-4" strokeWidth="1.75" />
 										<span