🐛 fix: prompt editor sync [#56]

main
canisminor1990 2023-05-05 18:09:52 +08:00
parent 54da9895da
commit 6e98494674
4 changed files with 88 additions and 88 deletions

1
.gitignore vendored
View File

@ -39,3 +39,4 @@ yarn.lock
venv venv
temp temp
.husky/prepare-commit-msg .husky/prepare-commit-msg
.husky/commit-msg

View File

@ -1,4 +0,0 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit ${1}

File diff suppressed because one or more lines are too long

View File

@ -55,6 +55,7 @@ const Prompt: React.FC<PromptProps> = ({ type }) => {
try { try {
const textarea: HTMLTextAreaElement | any = get_uiCurrentTabContent().querySelector(id) const textarea: HTMLTextAreaElement | any = get_uiCurrentTabContent().querySelector(id)
if (textarea) textarea.value = tags.map((t) => t.text).join(', ') if (textarea) textarea.value = tags.map((t) => t.text).join(', ')
updateInput(textarea)
} catch {} } catch {}
}, [tags]) }, [tags])
@ -62,6 +63,7 @@ const Prompt: React.FC<PromptProps> = ({ type }) => {
try { try {
const textarea: HTMLTextAreaElement | any = get_uiCurrentTabContent().querySelector(id) const textarea: HTMLTextAreaElement | any = get_uiCurrentTabContent().querySelector(id)
if (textarea) textarea.value = currentTags.map((t) => t.text).join(', ') if (textarea) textarea.value = currentTags.map((t) => t.text).join(', ')
updateInput(textarea)
} catch {} } catch {}
}, []) }, [])