mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
fix: handle non-array response when fetching Mihomo tags
This commit is contained in:
parent
392285058e
commit
7619b4d3e5
@ -324,9 +324,10 @@ const Mihomo: React.FC = () => {
|
||||
setLoadingTags(true)
|
||||
try {
|
||||
const data = await fetchMihomoTags(forceRefresh)
|
||||
setTags(data)
|
||||
setTags(Array.isArray(data) ? data : [])
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch tags:', error)
|
||||
setTags([])
|
||||
alert(t('mihomo.error.fetchTagsFailed'))
|
||||
} finally {
|
||||
setLoadingTags(false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user