@@ -117,7 +126,7 @@ export default class ColumnSettings extends React.PureComponent {
-
+
{showPushSettings &&
}
@@ -128,7 +137,7 @@ export default class ColumnSettings extends React.PureComponent {
-
+
{showPushSettings && }
diff --git a/app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.js b/app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.js
new file mode 100644
index 0000000000..798e4c7872
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.js
@@ -0,0 +1,19 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { FormattedMessage } from 'react-intl';
+
+export default class GrantPermissionButton extends React.PureComponent {
+
+ static propTypes = {
+ onClick: PropTypes.func.isRequired,
+ };
+
+ render () {
+ return (
+
+ );
+ }
+
+}
diff --git a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js
index 73fc05dea3..dd163225e9 100644
--- a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js
+++ b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js
@@ -2,7 +2,8 @@ import React from 'react';
import Icon from 'flavours/glitch/components/icon';
import Button from 'flavours/glitch/components/button';
import IconButton from 'flavours/glitch/components/icon_button';
-import { requestBrowserPermission, dismissBrowserPermission } from 'flavours/glitch/actions/notifications';
+import { requestBrowserPermission } from 'flavours/glitch/actions/notifications';
+import { changeSetting } from 'flavours/glitch/actions/settings';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@@ -25,7 +26,7 @@ class NotificationsPermissionBanner extends React.PureComponent {
}
handleClose = () => {
- this.props.dispatch(dismissBrowserPermission());
+ this.props.dispatch(changeSetting(['notifications', 'dismissPermissionBanner'], true));
}
render () {
diff --git a/app/javascript/flavours/glitch/features/notifications/index.js b/app/javascript/flavours/glitch/features/notifications/index.js
index 73d969517f..5ceda9a91c 100644
--- a/app/javascript/flavours/glitch/features/notifications/index.js
+++ b/app/javascript/flavours/glitch/features/notifications/index.js
@@ -69,7 +69,7 @@ const mapStateToProps = state => ({
notifCleaningActive: state.getIn(['notifications', 'cleaningMode']),
lastReadId: state.getIn(['local_settings', 'notifications', 'show_unread']) ? state.getIn(['notifications', 'readMarkerId']) : '0',
canMarkAsRead: state.getIn(['local_settings', 'notifications', 'show_unread']) && state.getIn(['notifications', 'readMarkerId']) !== '0' && getNotifications(state).some(item => item !== null && compareId(item.get('id'), state.getIn(['notifications', 'readMarkerId'])) > 0),
- needsNotificationPermission: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) === 'default',
+ needsNotificationPermission: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) === 'default' && !state.getIn(['settings', 'notifications', 'dismissPermissionBanner']),
});
/* glitch */
diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js
index c630cc7e3b..b4c5ef71a0 100644
--- a/app/javascript/flavours/glitch/reducers/notifications.js
+++ b/app/javascript/flavours/glitch/reducers/notifications.js
@@ -19,7 +19,6 @@ import {
NOTIFICATIONS_MARK_AS_READ,
NOTIFICATIONS_SET_BROWSER_SUPPORT,
NOTIFICATIONS_SET_BROWSER_PERMISSION,
- NOTIFICATIONS_DISMISS_BROWSER_PERMISSION,
} from 'flavours/glitch/actions/notifications';
import {
ACCOUNT_BLOCK_SUCCESS,
@@ -284,8 +283,6 @@ export default function notifications(state = initialState, action) {
return state.set('browserSupport', action.value);
case NOTIFICATIONS_SET_BROWSER_PERMISSION:
return state.set('browserPermission', action.value);
- case NOTIFICATIONS_DISMISS_BROWSER_PERMISSION:
- return state.set('browserPermission', 'denied');
case NOTIFICATION_MARK_FOR_DELETE:
return markForDelete(state, action.id, action.yes);
diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js
index bf0545c480..091b8feecf 100644
--- a/app/javascript/flavours/glitch/reducers/settings.js
+++ b/app/javascript/flavours/glitch/reducers/settings.js
@@ -48,6 +48,8 @@ const initialState = ImmutableMap({
advanced: false,
}),
+ dismissPermissionBanner: false,
+
shows: ImmutableMap({
follow: true,
follow_request: false,
diff --git a/app/javascript/flavours/glitch/styles/components/columns.scss b/app/javascript/flavours/glitch/styles/components/columns.scss
index 2550f50f47..2d080d3b9c 100644
--- a/app/javascript/flavours/glitch/styles/components/columns.scss
+++ b/app/javascript/flavours/glitch/styles/components/columns.scss
@@ -443,6 +443,12 @@
}
}
+.column-header__permission-btn {
+ display: inline;
+ font-weight: inherit;
+ text-decoration: underline;
+}
+
.column-header__setting-arrows {
float: right;
@@ -690,7 +696,7 @@
}
.column-settings__row {
- .text-btn {
+ .text-btn:not(.column-header__permission-btn) {
margin-bottom: 15px;
}
}