过下类型检查

This commit is contained in:
NanGua-QWQ
2026-02-12 22:21:30 +08:00
parent 5ca46fde9f
commit c64abc070e
@@ -25,7 +25,6 @@ export const TagEditorDialog: React.FC<TagEditorDialogProps> = ({
const [inputValue, setInputValue] = useState('') const [inputValue, setInputValue] = useState('')
const [allTags, setAllTags] = useState<Tag[]>([]) const [allTags, setAllTags] = useState<Tag[]>([])
const [selectedTagIds, setSelectedTagIds] = useState<Set<number>>(new Set(initialTagIds)) const [selectedTagIds, setSelectedTagIds] = useState<Set<number>>(new Set(initialTagIds))
const [loading, setLoading] = useState(false)
const { currentTheme } = useTheme() // 获取当前主题 const { currentTheme } = useTheme() // 获取当前主题
const themeMode = currentTheme?.mode || 'light'; // 默认为 light const themeMode = currentTheme?.mode || 'light'; // 默认为 light
@@ -40,7 +39,6 @@ export const TagEditorDialog: React.FC<TagEditorDialogProps> = ({
const fetchAllTags = async () => { const fetchAllTags = async () => {
if (!(window as any).api) return if (!(window as any).api) return
setLoading(true)
try { try {
const res = await (window as any).api.tagsGetAll() const res = await (window as any).api.tagsGetAll()
if (res.success && res.data) { if (res.success && res.data) {
@@ -49,8 +47,6 @@ export const TagEditorDialog: React.FC<TagEditorDialogProps> = ({
} catch (e) { } catch (e) {
console.error('Failed to fetch tags:', e) console.error('Failed to fetch tags:', e)
MessagePlugin.error('获取标签列表失败') MessagePlugin.error('获取标签列表失败')
} finally {
setLoading(false)
} }
} }
@@ -119,12 +115,12 @@ export const TagEditorDialog: React.FC<TagEditorDialogProps> = ({
} }
} }
const handleKeyDown = (value: string, context: { e: React.KeyboardEvent<HTMLInputElement> }) => { /* const handleKeyDown = (value: string, context: { e: React.KeyboardEvent<HTMLInputElement> }) => {
if (context.e.key === 'Enter') { if (context.e.key === 'Enter') {
context.e.preventDefault() context.e.preventDefault()
handleAddTag() handleAddTag()
} }
} } */
const handleConfirm = () => { const handleConfirm = () => {
onConfirm(Array.from(selectedTagIds)) onConfirm(Array.from(selectedTagIds))