mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-24 08:55:14 +03:00
added missing pieces required to support bookmark notifications
This commit is contained in:
parent
757bfcbb17
commit
119f537709
@ -5,6 +5,7 @@ import {
|
||||
CHANGE_FOLLOW_NOTIFICATION,
|
||||
CHANGE_MENTION_NOTIFICATION,
|
||||
CHANGE_FAVORITE_NOTIFICATION,
|
||||
CHANGE_BOOKMARK_NOTIFICATION,
|
||||
CHANGE_REBLOG_NOTIFICATION,
|
||||
CHANGE_TRANSFERS_NOTIFICATION,
|
||||
CHANGE_ALL_NOTIFICATION_SETTINGS,
|
||||
@ -110,6 +111,12 @@ export const changeNotificationSettings = (payload) => {
|
||||
type: CHANGE_FAVORITE_NOTIFICATION,
|
||||
};
|
||||
|
||||
case 'notification.bookmark':
|
||||
return {
|
||||
payload: payload.action,
|
||||
type: CHANGE_BOOKMARK_NOTIFICATION
|
||||
}
|
||||
|
||||
case 'notification.reblog':
|
||||
return {
|
||||
payload: payload.action,
|
||||
|
@ -28,6 +28,7 @@ export const CHANGE_VOTE_NOTIFICATION = 'CHANGE_VOTE_NOTIFICATION';
|
||||
export const CHANGE_COMMENT_NOTIFICATION = 'CHANGE_COMMENT_NOTIFICATION';
|
||||
export const CHANGE_MENTION_NOTIFICATION = 'CHANGE_MENTION_NOTIFICATION';
|
||||
export const CHANGE_FAVORITE_NOTIFICATION = 'CHANGE_FAVORITE_NOTIFICATION';
|
||||
export const CHANGE_BOOKMARK_NOTIFICATION = 'CHANGE_BOOKMARK_NOTIFICATION';
|
||||
export const CHANGE_REBLOG_NOTIFICATION = 'CHANGE_REBLOG_NOTIFICATION';
|
||||
export const CHANGE_TRANSFERS_NOTIFICATION = 'CHANGE_TRANSFERS_NOTIFICATION';
|
||||
export const CHANGE_ALL_NOTIFICATION_SETTINGS = 'CHANGE_ALL_NOTIFICATION_SETTINGS';
|
||||
|
@ -3,6 +3,7 @@ import {
|
||||
CHANGE_FOLLOW_NOTIFICATION,
|
||||
CHANGE_MENTION_NOTIFICATION,
|
||||
CHANGE_FAVORITE_NOTIFICATION,
|
||||
CHANGE_BOOKMARK_NOTIFICATION,
|
||||
CHANGE_REBLOG_NOTIFICATION,
|
||||
CHANGE_TRANSFERS_NOTIFICATION,
|
||||
CHANGE_VOTE_NOTIFICATION,
|
||||
@ -186,6 +187,13 @@ export default function (state = initialState, action): State {
|
||||
favoriteNotification: action.payload,
|
||||
},
|
||||
});
|
||||
case CHANGE_BOOKMARK_NOTIFICATION:
|
||||
return Object.assign({}, state, {
|
||||
notificationDetails: {
|
||||
...state.notificationDetails,
|
||||
bookmarkNotification: action.payload,
|
||||
},
|
||||
});
|
||||
case CHANGE_REBLOG_NOTIFICATION:
|
||||
return Object.assign({}, state, {
|
||||
notificationDetails: {
|
||||
|
@ -43,8 +43,8 @@ const persistConfig = {
|
||||
key: 'root',
|
||||
// Storage Method (React Native)
|
||||
storage: AsyncStorage,
|
||||
version: 1, // New version 0, default or previous version -1, versions are useful migrations
|
||||
// Blacklist (Don't Save Specific Reducers)
|
||||
version: 2, // New version 0, default or previous version -1, versions are useful migrations
|
||||
// // Blacklist (Don't Save Specific Reducers)
|
||||
blacklist: ['communities', 'user', 'ui'],
|
||||
timeout: 0,
|
||||
transforms: [transformCacheVoteMap, transformWalkthroughMap],
|
||||
|
@ -776,7 +776,7 @@ class ApplicationContainer extends Component {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
notify_types = [1, 2, 3, 4, 5, 6];
|
||||
notify_types = [1, 2, 3, 4, 5, 6, 13, 15];
|
||||
}
|
||||
|
||||
messaging()
|
||||
|
@ -216,6 +216,8 @@ class LoginContainer extends PureComponent {
|
||||
comment: 4,
|
||||
reblog: 5,
|
||||
transfers: 6,
|
||||
favorite: 13,
|
||||
bookmark: 15,
|
||||
};
|
||||
const notifyTypes = [];
|
||||
|
||||
@ -236,9 +238,11 @@ class LoginContainer extends PureComponent {
|
||||
system: `fcm-${Platform.OS}`,
|
||||
allows_notify: Number(notificationSettings),
|
||||
notify_types: notifyTypes,
|
||||
|
||||
};
|
||||
setPushToken(data).then(() => {
|
||||
setPushTokenSaved(true);
|
||||
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -173,6 +173,10 @@ const reduxMigrations = {
|
||||
state.application.notificationDetails.favoriteNotification = true;
|
||||
return state;
|
||||
},
|
||||
2: (state) => {
|
||||
state.application.notificationDetails.bookmarkNotification = true;
|
||||
return state;
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
|
Loading…
Reference in New Issue
Block a user