From 6aa3cc4a557efaa9e3262202f4a98ff960255b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=9D=B1=E6=BE=94?= Date: Sun, 23 Jan 2022 15:19:04 +0800 Subject: [PATCH 1/2] fix: when autoPlay is false, manual sliding will still autoPlay fix #111 --- src/hooks/useAutoPlay.ts | 5 ++++- yarn.lock | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/useAutoPlay.ts b/src/hooks/useAutoPlay.ts index b5b845b1..af5c40d6 100644 --- a/src/hooks/useAutoPlay.ts +++ b/src/hooks/useAutoPlay.ts @@ -35,9 +35,12 @@ export function useAutoPlay(opts: { }, []); const start = React.useCallback(() => { + if (!autoPlay) { + return; + } stopped.current = false; play(); - }, [play]); + }, [play, autoPlay]); React.useEffect(() => { if (autoPlay) { diff --git a/yarn.lock b/yarn.lock index 0c8f0749..992fc823 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3607,7 +3607,7 @@ cz-conventional-changelog@3.2.0: cz-conventional-changelog@^3.3.0: version "3.3.0" - resolved "https://registry.npm.taobao.org/cz-conventional-changelog/download/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2" + resolved "https://registry.nlark.com/cz-conventional-changelog/download/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2" integrity sha1-kkaUfJBAQUmz/iz37pGsrTt9ItI= dependencies: chalk "^2.4.1" From 122082b44c32272b9916f538efb3bb1f9807eef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=9D=B1=E6=BE=94?= Date: Sun, 23 Jan 2022 15:20:47 +0800 Subject: [PATCH 2/2] Update yarn.lock --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 992fc823..0c8f0749 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3607,7 +3607,7 @@ cz-conventional-changelog@3.2.0: cz-conventional-changelog@^3.3.0: version "3.3.0" - resolved "https://registry.nlark.com/cz-conventional-changelog/download/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2" + resolved "https://registry.npm.taobao.org/cz-conventional-changelog/download/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2" integrity sha1-kkaUfJBAQUmz/iz37pGsrTt9ItI= dependencies: chalk "^2.4.1"