mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-06 04:53:56 +03:00
fix: ai completion
This commit is contained in:
parent
0a0f0f950a
commit
b8c7c69012
2 changed files with 12 additions and 9 deletions
|
@ -140,6 +140,7 @@ function NoteTextArea({ value, onChange, preview = false }) {
|
|||
maxLength={5000}
|
||||
onChange={onChange}
|
||||
defaultValue={value}
|
||||
id="noteTextArea"
|
||||
></textarea>
|
||||
);
|
||||
}
|
||||
|
@ -159,8 +160,9 @@ function NotesAdditionalSettings({
|
|||
text={locals.AIComplete}
|
||||
className="m-1"
|
||||
w="w-full"
|
||||
onClick={() => {
|
||||
let text = Complete(noteText);
|
||||
onClick={async () => {
|
||||
let text = await Complete(noteText);
|
||||
document.getElementById("noteTextArea").value = text;
|
||||
|
||||
onClick(text);
|
||||
}}
|
||||
|
|
|
@ -58,13 +58,14 @@ function NotePage() {
|
|||
value={note.text}
|
||||
onChange={(e) => (note.text = e.target.value)}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 justify-items-center w-full">
|
||||
<NotesAdditionalSettings
|
||||
noteText={note.text}
|
||||
onClick={(text) => {
|
||||
note.text = text;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<Note note={note} />
|
||||
|
|
Loading…
Reference in a new issue