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 () { function start () {
clear() clear()
progress.value = 0 progress.value = 0
if (opts.throttle && process.client) {
_throttle = setTimeout(() => {
isLoading.value = true isLoading.value = true
if (opts.throttle) { _startTimer()
if (process.client) { }, opts.throttle)
_throttle = setTimeout(_startTimer, opts.throttle)
}
} else { } else {
isLoading.value = true
_startTimer() _startTimer()
} }
} }
function finish () { function finish () {
progress.value = 100 progress.value = 100
_hide() _hide()