]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #620 - Add confirmation dialog for notifications clear
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 2 Mar 2017 18:24:12 +0000 (19:24 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 2 Mar 2017 18:24:12 +0000 (19:24 +0100)
app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx
app/assets/javascripts/components/features/notifications/index.jsx

index 0b7c737c6ba9040efbffdebdb915e39588a2ee0a..d75149a0e3f3fdded76965e10f89ebc00ba2cee3 100644 (file)
@@ -4,7 +4,8 @@ const iconStyle = {
   position: 'absolute',
   right: '48px',
   top: '0',
-  cursor: 'pointer'
+  cursor: 'pointer',
+  zIndex: '2'
 };
 
 const ClearColumnButton = ({ onClick }) => (
index 0da3544f6b23c5b0f6816622ca590e16878b0a70..8d3f4233df61e1da0c67c1d4d53ec60464f272ae 100644 (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) {