mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
修复在某些情况下打开播放详情页时可能会导致应用崩溃的问题
This commit is contained in:
parent
ff790cc884
commit
42f73dd2da
@ -19,12 +19,10 @@ export default memo(({ componentId }: { componentId: string }) => {
|
|||||||
const { width: winWidth, height: winHeight } = useWindowSize()
|
const { width: winWidth, height: winHeight } = useWindowSize()
|
||||||
const statusBarHeight = useStatusbarHeight()
|
const statusBarHeight = useStatusbarHeight()
|
||||||
|
|
||||||
const [animated, setAnimated] = useState(false)
|
const [animated, setAnimated] = useState(!!commonState.componentIds.playDetail)
|
||||||
const [pic, setPic] = useState(musicInfo.pic)
|
const [pic, setPic] = useState(musicInfo.pic)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (commonState.componentIds.playDetail) setAnimated(true)
|
if (animated) setPic(musicInfo.pic)
|
||||||
else if (!animated) return
|
|
||||||
setPic(musicInfo.pic)
|
|
||||||
}, [musicInfo.pic, animated])
|
}, [musicInfo.pic, animated])
|
||||||
|
|
||||||
useNavigationComponentDidAppear(componentId, () => {
|
useNavigationComponentDidAppear(componentId, () => {
|
||||||
|
@ -17,12 +17,10 @@ export default ({ componentId }: { componentId: string }) => {
|
|||||||
const { width: winWidth, height: winHeight } = useWindowSize()
|
const { width: winWidth, height: winHeight } = useWindowSize()
|
||||||
const statusBarHeight = useStatusbarHeight()
|
const statusBarHeight = useStatusbarHeight()
|
||||||
|
|
||||||
const [animated, setAnimated] = useState(false)
|
const [animated, setAnimated] = useState(!!commonState.componentIds.playDetail)
|
||||||
const [pic, setPic] = useState(musicInfo.pic)
|
const [pic, setPic] = useState(musicInfo.pic)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (commonState.componentIds.playDetail) setAnimated(true)
|
if (animated) setPic(musicInfo.pic)
|
||||||
else if (!animated) return
|
|
||||||
setPic(musicInfo.pic)
|
|
||||||
}, [musicInfo.pic, animated])
|
}, [musicInfo.pic, animated])
|
||||||
|
|
||||||
useNavigationComponentDidAppear(componentId, () => {
|
useNavigationComponentDidAppear(componentId, () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user