Browse Source

#103 タグ補完からニコタグ除外

feature/103
みてるぞ 2 weeks ago
parent
commit
e2eca8adfe
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      frontend/src/components/PostFormTagsArea.tsx

+ 3
- 3
frontend/src/components/PostFormTagsArea.tsx View File

@@ -25,8 +25,8 @@ const getTokenAt = (value: string, pos: number) => {
}


const replaceToken = (value: string, start: number, end: number, text: string) => (
`${ value.slice (0, start) }${ text }${ value.slice (end) }`)
const replaceToken = (value: string, start: number, end: number, text: string) =>
`${ value.slice (0, start) }${ text }${ value.slice (end) }`


type Props = {
@@ -57,7 +57,7 @@ export default (({ tags, setTags }: Props) => {
const recompute = async (pos: number, v: string = tags) => {
const { start, end, token } = getTokenAt (v, pos)
setBounds ({ start, end })
const data = await apiGet<Tag[]> ('/tags/autocomplete', { params: { q: token } })
const data = await apiGet<Tag[]> ('/tags/autocomplete', { params: { q: token, nico: 0 } })
setSuggestions (data.filter (t => t.postCount > 0))
setSuggestionsVsbl (suggestions.length > 0)
}


Loading…
Cancel
Save