From bbb25c6b6ad11693723b3039bf724a8c346ffd4e Mon Sep 17 00:00:00 2001 From: Shawn Gustaw Date: Wed, 18 Oct 2023 12:41:30 -0700 Subject: [PATCH] Support disabling same route when using shallow routing --- src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index e56ba0b..53dcd04 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -43,9 +43,9 @@ const NextProgress = React.memo( options && NProgress.configure(options); let timeout: NodeJS.Timeout; - const start: Handler = (e) => { + const start: Handler = (e, { shallow }) => { clearTimeout(timeout); - if (disableSameRoute && Router.route === e) return; + if (disableSameRoute && (shallow || Router.route === e)) return; timeout = setTimeout(() => NProgress.start(), delay); }, done: Handler = () => {