Skip to content

Commit

Permalink
[Snackbar] Improve the comments in the code
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 2, 2017
1 parent a8140ef commit 9e9ae3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Snackbar/Snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,14 @@ class Snackbar extends React.Component<AllProps, State> {
}
};

// Pause the timer when the user is interacting with the Snackbar or when he can't see it.
// Pause the timer when the user is interacting with the Snackbar
// or when the user hide the window.
handlePause = () => {
clearTimeout(this.timerAutoHide);
};

// Restart the timer when the user is no longer interacting with the Snackbar
// or when the window is shown back.
handleResume = () => {
if (this.props.autoHideDuration !== null) {
this.setAutoHideTimer(this.props.autoHideDuration * 0.5);
Expand Down

0 comments on commit 9e9ae3a

Please sign in to comment.