Fix: config.history may be empty (#16)

This commit is contained in:
Pazzilivo 2019-10-27 23:17:50 +08:00 committed by Dreamacro
parent 73bf262728
commit cf9da3125e

View File

@ -43,7 +43,7 @@ export function Proxy (props: ProxyProps) {
}
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])
useLayoutEffect(() => {