ソースを参照

fix: remove redundant useEffect from TagSelector component (#23406)

tags/1.7.2
lyzno1 2ヶ月前
コミット
607dfc8be7
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更1行の追加6行の削除
  1. 1
    6
      web/app/components/base/tag-management/selector.tsx

+ 1
- 6
web/app/components/base/tag-management/selector.tsx ファイルの表示

@@ -1,5 +1,5 @@
import type { FC } from 'react'
import { useEffect, useMemo, useState } from 'react'
import { useMemo, useState } from 'react'
import { useContext } from 'use-context-selector'
import { useTranslation } from 'react-i18next'
import { useUnmount } from 'ahooks'
@@ -231,11 +231,6 @@ const TagSelector: FC<TagSelectorProps> = ({
}
}

useEffect(() => {
if (tagList.length === 0)
getTagList()
}, [type])

const triggerContent = useMemo(() => {
if (selectedTags?.length)
return selectedTags.filter(selectedTag => tagList.find(tag => tag.id === selectedTag.id)).map(tag => tag.name).join(', ')

読み込み中…
キャンセル
保存