Skip to content

Commit

Permalink
Wait end animation before reset values
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-WorkGH committed Dec 14, 2023
1 parent f9affbc commit 39cbaaa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/TopBar/AboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ const AboutDialog = ({
} else {
setModules([currentApp]);
}
} else {
// we wait the end of the fade animation of the dialog before reset content
setTimeout(
(setModules, setActualGlobalVersion) => {
setModules(null);
setActualGlobalVersion(null);
},
195 + 5,
setModules,
setActualGlobalVersion
);
}
}, [
open,
Expand All @@ -130,8 +141,6 @@ const AboutDialog = ({
if (onClose) {
onClose();
}
setModules(null);
setActualGlobalVersion(null);
}, [onClose]);

return (
Expand All @@ -143,6 +152,7 @@ const AboutDialog = ({
fullScreen={useMediaQuery(theme.breakpoints.down('md'))}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
transitionDuration={{ exit: 195 }}
>
<DialogTitle id="alert-dialog-title">
<FormattedMessage id={'about-dialog/title'} />
Expand Down

0 comments on commit 39cbaaa

Please sign in to comment.