From 7f4f10a733ae2ae1023929a37fe0ab4136e56a7e Mon Sep 17 00:00:00 2001 From: Alejandro Romano Date: Mon, 2 Jan 2023 15:20:53 -0300 Subject: [PATCH] fix(nuxt): set is loading state for `` after throttle (#9832) --- .../src/app/components/nuxt-loading-indicator.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nuxt/src/app/components/nuxt-loading-indicator.ts b/packages/nuxt/src/app/components/nuxt-loading-indicator.ts index 30cfc82e8b..e172ebbcdd 100644 --- a/packages/nuxt/src/app/components/nuxt-loading-indicator.ts +++ b/packages/nuxt/src/app/components/nuxt-loading-indicator.ts @@ -68,16 +68,16 @@ function useLoadingIndicator (opts: { function start () { clear() progress.value = 0 - isLoading.value = true - if (opts.throttle) { - if (process.client) { - _throttle = setTimeout(_startTimer, opts.throttle) - } + if (opts.throttle && process.client) { + _throttle = setTimeout(() => { + isLoading.value = true + _startTimer() + }, opts.throttle) } else { + isLoading.value = true _startTimer() } } - function finish () { progress.value = 100 _hide()