Skip to content

Commit

Permalink
git commit fix bug with device faide out in devices list
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlobu committed May 31, 2022
1 parent ae5de8d commit 10d8d78
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions app/components/ConnectedDevicesListDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type DeviceWithDesktopCapturerSourceId = Device & {
desktopCapturerSourceId: string;
};

const ANIMATION_DURATION = 700;

const Fade = require('react-reveal/Fade');

interface ConnectedDevicesListDrawerProps {
Expand Down Expand Up @@ -134,6 +136,10 @@ export default function ConnectedDevicesListDrawer(
const newDevicesDisplayed = new Map(devicesDisplayed);
newDevicesDisplayed.set(id, false);
setDevicesDisplayed(newDevicesDisplayed);
setTimeout(() => {
newDevicesDisplayed.delete(id);
setDevicesDisplayed(newDevicesDisplayed);
}, ANIMATION_DURATION);
},
[devicesDisplayed, setDevicesDisplayed]
);
Expand Down Expand Up @@ -182,7 +188,9 @@ export default function ConnectedDevicesListDrawer(
size={Drawer.SIZE_LARGE}
isOpen={props.isOpen}
onClose={props.handleToggle}
transitionDuration={isWithReactRevealAnimations() ? 700 : 0}
transitionDuration={
isWithReactRevealAnimations() ? ANIMATION_DURATION : 0
}
>
<Row between="xs" middle="xs" className={classes.drawerInnerTopPanel}>
<Col xs={11}>
Expand Down Expand Up @@ -214,7 +222,7 @@ export default function ConnectedDevicesListDrawer(
<Fade
bottom
cascade
duration={isWithReactRevealAnimations() ? 700 : 0}
duration={isWithReactRevealAnimations() ? ANIMATION_DURATION : 0}
>
<div className={classes.zoomFullWidth}>
{connectedDevices.map((device) => {
Expand All @@ -224,7 +232,7 @@ export default function ConnectedDevicesListDrawer(
collapse
opposite
when={devicesDisplayed.get(device.id)}
duration={isProduction() ? 700 : 0}
duration={isProduction() ? ANIMATION_DURATION : 0}
>
<Card className="connected-device-card">
<Row middle="xs">
Expand Down Expand Up @@ -283,7 +291,9 @@ export default function ConnectedDevicesListDrawer(
setIsAlertDisconectAllOpen(false);
}}
onConfirm={handleDisconnectAndHideAllDevices}
transitionDuration={isWithReactRevealAnimations() ? 700 : 0}
transitionDuration={
isWithReactRevealAnimations() ? ANIMATION_DURATION : 0
}
>
<H4>
{t(
Expand Down

0 comments on commit 10d8d78

Please sign in to comment.