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 [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> = (props) => {
const setNextPicture = () => {
let index = bgPicture
if (bgPicture >= PICTURES_COUNT - 1) {
index = 1
index = 0
} else {
index += 1
}