f54ca3d08e
* Add notification permission handling code * Request notification permission when enabling any notification setting * Add badge to notification settings when permissions insufficient * Disable alerts by default, requesting permission and enable them on onboarding
10 lines
471 B
JavaScript
10 lines
471 B
JavaScript
import { connect } from 'react-redux';
|
|
import IconWithBadge from 'mastodon/components/icon_with_badge';
|
|
|
|
const mapStateToProps = state => ({
|
|
count: state.getIn(['notifications', 'unread']),
|
|
issueBadge: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) !== 'granted',
|
|
id: 'bell',
|
|
});
|
|
|
|
export default connect(mapStateToProps)(IconWithBadge);
|