fix viewer background

This commit is contained in:
Pig Fang 2020-07-04 18:10:13 +08:00
parent 62ac0f5f9c
commit 2bfa018e96
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2

View File

@ -81,7 +81,7 @@ const Viewer: React.FC<Props> = (props) => {
const [running, setRunning] = useState(false) const [running, setRunning] = useState(false)
const [reset, setReset] = useState(0) const [reset, setReset] = useState(0)
const [background, setBackground] = useState('#fff') const [background, setBackground] = useState('#fff')
const [bgPicture, setBgPicture] = useState(0) const [bgPicture, setBgPicture] = useState(-1)
const indicator = (() => { const indicator = (() => {
const { skin, cape } = props const { skin, cape } = props
@ -197,7 +197,7 @@ const Viewer: React.FC<Props> = (props) => {
const setNextPicture = () => { const setNextPicture = () => {
let index = bgPicture let index = bgPicture
if (bgPicture >= PICTURES_COUNT - 1) { if (bgPicture >= PICTURES_COUNT - 1) {
index = 1 index = 0
} else { } else {
index += 1 index += 1
} }