Fix lightbox spinner (#6561)
* refactor imageitem useanimatedreaction logic * revert copy/paste fix * revert last commit * Fix conditions --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
@@ -363,10 +363,10 @@ const ImageItem = ({
|
||||
return transforms.get().isResting && !hasLoaded
|
||||
},
|
||||
(show, prevShow) => {
|
||||
if (show && !prevShow) {
|
||||
runOnJS(setShowLoader)(false)
|
||||
} else if (!prevShow && show) {
|
||||
if (!prevShow && show) {
|
||||
runOnJS(setShowLoader)(true)
|
||||
} else if (prevShow && !show) {
|
||||
runOnJS(setShowLoader)(false)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -187,10 +187,10 @@ const ImageItem = ({
|
||||
return transforms.get().isResting && !hasLoaded
|
||||
},
|
||||
(show, prevShow) => {
|
||||
if (show && !prevShow) {
|
||||
runOnJS(setShowLoader)(false)
|
||||
} else if (!prevShow && show) {
|
||||
if (!prevShow && show) {
|
||||
runOnJS(setShowLoader)(true)
|
||||
} else if (prevShow && !show) {
|
||||
runOnJS(setShowLoader)(false)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user