mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 11:35:29 +01:00
Fix #620 - Add confirmation dialog for notifications clear
This commit is contained in:
parent
4d23a85c29
commit
b9345b3fc6
@ -4,7 +4,8 @@ const iconStyle = {
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: '48px',
|
right: '48px',
|
||||||
top: '0',
|
top: '0',
|
||||||
cursor: 'pointer'
|
cursor: 'pointer',
|
||||||
|
zIndex: '2'
|
||||||
};
|
};
|
||||||
|
|
||||||
const ClearColumnButton = ({ onClick }) => (
|
const ClearColumnButton = ({ onClick }) => (
|
||||||
|
@ -13,7 +13,8 @@ import LoadMore from '../../components/load_more';
|
|||||||
import ClearColumnButton from './components/clear_column_button';
|
import ClearColumnButton from './components/clear_column_button';
|
||||||
|
|
||||||
const messages = defineMessages({
|
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([
|
const getNotifications = createSelector([
|
||||||
@ -72,7 +73,9 @@ const Notifications = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleClear () {
|
handleClear () {
|
||||||
|
if (window.confirm(this.props.intl.formatMessage(messages.confirm))) {
|
||||||
this.props.dispatch(clearNotifications());
|
this.props.dispatch(clearNotifications());
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setRef (c) {
|
setRef (c) {
|
||||||
|
Loading…
Reference in New Issue
Block a user