fix(nuxt): set is loading state for <NuxtLoadingIndicator> after throttle (#9832)

This commit is contained in:
Alejandro Romano 2023-01-02 15:20:53 -03:00 committed by GitHub
parent f3263ebb9d
commit 7f4f10a733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,16 +68,16 @@ function useLoadingIndicator (opts: {
function start () {
clear()
progress.value = 0
if (opts.throttle && process.client) {
_throttle = setTimeout(() => {
isLoading.value = true
if (opts.throttle) {
if (process.client) {
_throttle = setTimeout(_startTimer, opts.throttle)
}
_startTimer()
}, opts.throttle)
} else {
isLoading.value = true
_startTimer()
}
}
function finish () {
progress.value = 100
_hide()