From 2bfa018e96ad4bcd9a99f07305bc9736c0d851ff Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 4 Jul 2020 18:10:13 +0800 Subject: [PATCH] fix viewer background --- resources/assets/src/components/Viewer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/src/components/Viewer.tsx b/resources/assets/src/components/Viewer.tsx index b4224d22..fad24f22 100644 --- a/resources/assets/src/components/Viewer.tsx +++ b/resources/assets/src/components/Viewer.tsx @@ -81,7 +81,7 @@ const Viewer: React.FC = (props) => { const [running, setRunning] = useState(false) const [reset, setReset] = useState(0) const [background, setBackground] = useState('#fff') - const [bgPicture, setBgPicture] = useState(0) + const [bgPicture, setBgPicture] = useState(-1) const indicator = (() => { const { skin, cape } = props @@ -197,7 +197,7 @@ const Viewer: React.FC = (props) => { const setNextPicture = () => { let index = bgPicture if (bgPicture >= PICTURES_COUNT - 1) { - index = 1 + index = 0 } else { index += 1 }