Fix raised hand list button hiding after fade out
This commit is contained in:
parent
6c38823b50
commit
a184fd377f
1 changed files with 5 additions and 8 deletions
|
@ -203,12 +203,6 @@ export function CallingRaisedHandsListButton({
|
||||||
syncedLocalHandRaised
|
syncedLocalHandRaised
|
||||||
);
|
);
|
||||||
|
|
||||||
const onRestAfterAnimateOut = React.useCallback(() => {
|
|
||||||
if (!raisedHandsCount) {
|
|
||||||
setIsVisible(false);
|
|
||||||
}
|
|
||||||
}, [raisedHandsCount]);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (raisedHandsCount > prevRaisedHandsCount) {
|
if (raisedHandsCount > prevRaisedHandsCount) {
|
||||||
setIsVisible(true);
|
setIsVisible(true);
|
||||||
|
@ -230,7 +224,11 @@ export function CallingRaisedHandsListButton({
|
||||||
Promise.all(
|
Promise.all(
|
||||||
opacitySpringApi.start({
|
opacitySpringApi.start({
|
||||||
to: { opacity: 0 },
|
to: { opacity: 0 },
|
||||||
onRest: () => onRestAfterAnimateOut,
|
onRest: () => {
|
||||||
|
if (!raisedHandsCount) {
|
||||||
|
setIsVisible(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -240,7 +238,6 @@ export function CallingRaisedHandsListButton({
|
||||||
prevRaisedHandsCount,
|
prevRaisedHandsCount,
|
||||||
opacitySpringApi,
|
opacitySpringApi,
|
||||||
scaleSpringApi,
|
scaleSpringApi,
|
||||||
onRestAfterAnimateOut,
|
|
||||||
setIsVisible,
|
setIsVisible,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue