mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 12:51:42 +03:00
commit
8fb6cc975e
@ -189,8 +189,6 @@ class NotificationView extends PureComponent {
|
||||
_notifications && _notifications.length > 0 ? (
|
||||
<FlatList
|
||||
data={_notifications}
|
||||
refreshing={isNotificationRefreshing}
|
||||
onRefresh={() => getActivities()}
|
||||
keyExtractor={(item) => item.title}
|
||||
onEndReached={() => getActivities(null, selectedFilter, true)}
|
||||
ListFooterComponent={this._renderFooterLoading}
|
||||
@ -199,6 +197,7 @@ class NotificationView extends PureComponent {
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={isNotificationRefreshing}
|
||||
onRefresh={() => getActivities()}
|
||||
progressBackgroundColor="#357CE6"
|
||||
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
|
||||
titleColor="#fff"
|
||||
|
@ -75,7 +75,11 @@ import {
|
||||
setPinCode as savePinCode,
|
||||
isRenderRequired,
|
||||
} from '../../../redux/actions/applicationActions';
|
||||
import { hideActionModal, updateActiveBottomTab } from '../../../redux/actions/uiAction';
|
||||
import {
|
||||
hideActionModal,
|
||||
toastNotification,
|
||||
updateActiveBottomTab,
|
||||
} from '../../../redux/actions/uiAction';
|
||||
|
||||
import { encryptKey } from '../../../utils/crypto';
|
||||
|
||||
@ -457,6 +461,15 @@ class ApplicationContainer extends Component {
|
||||
}
|
||||
};
|
||||
|
||||
_showNotificationToast = (remoteMessage) => {
|
||||
const { dispatch } = this.props;
|
||||
|
||||
if (remoteMessage && remoteMessage.notification) {
|
||||
const { title } = remoteMessage.notification;
|
||||
dispatch(toastNotification(title));
|
||||
}
|
||||
};
|
||||
|
||||
_createPushListener = () => {
|
||||
(async () => await messaging().requestPermission())();
|
||||
|
||||
@ -464,6 +477,7 @@ class ApplicationContainer extends Component {
|
||||
PushNotification.cancelAllLocalNotifications();
|
||||
|
||||
firebaseOnMessageListener = messaging().onMessage((remoteMessage) => {
|
||||
this._showNotificationToast(remoteMessage);
|
||||
this._pushNavigate(remoteMessage);
|
||||
});
|
||||
|
||||
|
@ -41,7 +41,7 @@ class NotificationContainer extends Component {
|
||||
const since = loadMore ? lastNotificationId : null;
|
||||
const { username } = this.props;
|
||||
|
||||
if (!endOfNotification) {
|
||||
if (!endOfNotification || !loadMore) {
|
||||
this.setState({ isNotificationRefreshing: true });
|
||||
getActivities({ user: user || username, type, since })
|
||||
.then((res) => {
|
||||
|
Loading…
Reference in New Issue
Block a user