[fix] unneccessary loading ending before pushing home page
This commit is contained in:
@@ -52,16 +52,18 @@ export function Prepare() {
|
|||||||
trailing: true,
|
trailing: true,
|
||||||
maxWait: 2500,
|
maxWait: 2500,
|
||||||
})
|
})
|
||||||
|
const [checkCount, setCheckCount] = useState(0)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setCheckCount((prev) => (prev >= 10 ? 10 : prev + 1))
|
||||||
// console.log(checkCount, "触发", debounceValid, steam.state.steamDir, steam.state.cs2Dir)
|
// console.log(checkCount, "触发", debounceValid, steam.state.steamDir, steam.state.cs2Dir)
|
||||||
if (debounceValid && app.state.inited) {
|
if (checkCount < 2 && debounceValid && app.state.inited) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.push("/home")
|
router.push("/home")
|
||||||
}, 500)
|
}, 800)
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}, 800)
|
}, 1000)
|
||||||
}
|
}
|
||||||
}, [debounceValid])
|
}, [debounceValid])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user