FIX lint error

This commit is contained in:
NanGua-QWQ
2026-02-22 17:10:12 +08:00
parent 7616a664a0
commit efa78f2bce
5 changed files with 23 additions and 16 deletions
@@ -29,15 +29,8 @@ export const TagEditorDialog: React.FC<TagEditorDialogProps> = ({
const themeMode = currentTheme?.mode || 'light' // 默认为 light
useEffect(() => {
if (visible) {
setSelectedTagIds(new Set(initialTagIds))
setInputValue('')
fetchAllTags()
}
}, [visible, initialTagIds])
const fetchAllTags = async () => {
// fetchAllTags is declared as a function so it can be called from useEffect
async function fetchAllTags() {
if (!(window as any).api) return
try {
const res = await (window as any).api.tagsGetAll()
@@ -50,6 +43,14 @@ export const TagEditorDialog: React.FC<TagEditorDialogProps> = ({
}
}
useEffect(() => {
if (visible) {
setSelectedTagIds(new Set(initialTagIds))
setInputValue('')
fetchAllTags()
}
}, [visible, initialTagIds])
const handleAddTag = async () => {
const trimmed = inputValue.trim()
if (!trimmed) return
@@ -29,7 +29,9 @@ const RandomTimeTrigger: React.FC<TriggerComponentProps> = ({ value, onChange })
const parsed = JSON.parse(value)
config = { ...config, ...parsed }
}
} catch {}
} catch (e) {
console.debug('RandomTimeTrigger parse error', e)
}
const handleChange = (key: keyof RandomTimeConfig, v: any) => {
const numV = typeof v === 'number' ? v : v ? Number(v) : undefined