mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: config.history may be empty (#16)
This commit is contained in:
parent
73bf262728
commit
cf9da3125e
@ -43,7 +43,7 @@ export function Proxy (props: ProxyProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setDelay(config.history.length ? config.history.slice(-1)[0].delay : 0)
|
setDelay(config.history && config.history.length ? config.history.slice(-1)[0].delay : 0)
|
||||||
}, [config])
|
}, [config])
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user