Removed read all notification alert

This commit is contained in:
Mustafa Buyukcelebi 2018-12-10 15:55:56 +03:00
parent ea1c0e644f
commit 99447628aa

View File

@ -1,7 +1,5 @@
import React, { Component } from 'react';
import { Alert } from 'react-native';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
// Actions and Services
import { getActivities, markActivityAsRead } from '../../../providers/esteem/esteem';
@ -65,20 +63,12 @@ class NotificationContainer extends Component {
};
_readAllNotification = () => {
const { username, dispatch, intl } = this.props;
const { username, dispatch } = this.props;
const { notifications } = this.state;
markActivityAsRead(username).then((result) => {
dispatch(updateUnreadActivityCount(result.unread));
const updatedNotifications = notifications.map(item => ({ ...item, read: 1 }));
this.setState({ notifications: updatedNotifications });
Alert.alert(
intl.formatMessage({
id: 'alert.success',
}),
intl.formatMessage({
id: 'alert.allRead',
}),
);
});
};
@ -102,4 +92,4 @@ const mapStateToProps = state => ({
activeBottomTab: state.ui.activeBottomTab,
});
export default connect(mapStateToProps)(injectIntl(NotificationContainer));
export default connect(mapStateToProps)(NotificationContainer);