Browse Source

Fix #620 - Add confirmation dialog for notifications clear

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
b9345b3fc6
2 changed files with 7 additions and 3 deletions
  1. +2
    -1
      app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx
  2. +5
    -2
      app/assets/javascripts/components/features/notifications/index.jsx

+ 2
- 1
app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx View File

@ -4,7 +4,8 @@ const iconStyle = {
position: 'absolute',
right: '48px',
top: '0',
cursor: 'pointer'
cursor: 'pointer',
zIndex: '2'
};
const ClearColumnButton = ({ onClick }) => (

+ 5
- 2
app/assets/javascripts/components/features/notifications/index.jsx View File

@ -13,7 +13,8 @@ import LoadMore from '../../components/load_more';
import ClearColumnButton from './components/clear_column_button';
const messages = defineMessages({
title: { id: 'column.notifications', defaultMessage: 'Notifications' }
title: { id: 'column.notifications', defaultMessage: 'Notifications' },
confirm: { id: 'confirmation.label', defaultMessage: 'Are you sure?' }
});
const getNotifications = createSelector([
@ -72,7 +73,9 @@ const Notifications = React.createClass({
},
handleClear () {
this.props.dispatch(clearNotifications());
if (window.confirm(this.props.intl.formatMessage(messages.confirm))) {
this.props.dispatch(clearNotifications());
}
},
setRef (c) {

Loading…
Cancel
Save