Tweak update notification settings

This commit is contained in:
Thomas Nordquist
2019-01-13 21:08:55 +01:00
parent 87f0f06a07
commit 225f536cd1

View File

@@ -51,12 +51,19 @@ class UpdateNotifier extends React.Component<Props, {}> {
this.props.actions.showUpdateNotification(true) this.props.actions.showUpdateNotification(true)
} }
private onCloseNotification = (event: React.SyntheticEvent<any>, reason: string) => {
if (reason === 'clickaway') {
return
}
this.props.actions.showUpdateNotification(false)
}
private closeNotification = () => { private closeNotification = () => {
this.props.actions.showUpdateNotification(false) this.props.actions.showUpdateNotification(false)
} }
private showDetails = () => { private showDetails = () => {
this.closeNotification() this.props.actions.showUpdateNotification(false)
this.props.actions.showUpdateDetails(true) this.props.actions.showUpdateDetails(true)
} }
@@ -74,7 +81,7 @@ class UpdateNotifier extends React.Component<Props, {}> {
} }
private renderUpdateNotification() { private renderUpdateNotification() {
const snackbarAnchor = { const snackbarAnchor: any = {
vertical: 'top', vertical: 'top',
horizontal: 'right', horizontal: 'right',
} }
@@ -83,8 +90,8 @@ class UpdateNotifier extends React.Component<Props, {}> {
<Snackbar <Snackbar
anchorOrigin={snackbarAnchor} anchorOrigin={snackbarAnchor}
open={this.props.showUpdateNotification} open={this.props.showUpdateNotification}
autoHideDuration={6000} autoHideDuration={7000}
onClose={this.closeNotification} onClose={this.onCloseNotification}
> >
<SnackbarContent <SnackbarContent
className={this.props.classes.success} className={this.props.classes.success}