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_FOLLOW_NOTIFICATION,
|
||||||
CHANGE_MENTION_NOTIFICATION,
|
CHANGE_MENTION_NOTIFICATION,
|
||||||
CHANGE_FAVORITE_NOTIFICATION,
|
CHANGE_FAVORITE_NOTIFICATION,
|
||||||
|
CHANGE_BOOKMARK_NOTIFICATION,
|
||||||
CHANGE_REBLOG_NOTIFICATION,
|
CHANGE_REBLOG_NOTIFICATION,
|
||||||
CHANGE_TRANSFERS_NOTIFICATION,
|
CHANGE_TRANSFERS_NOTIFICATION,
|
||||||
CHANGE_ALL_NOTIFICATION_SETTINGS,
|
CHANGE_ALL_NOTIFICATION_SETTINGS,
|
||||||
@ -110,6 +111,12 @@ export const changeNotificationSettings = (payload) => {
|
|||||||
type: CHANGE_FAVORITE_NOTIFICATION,
|
type: CHANGE_FAVORITE_NOTIFICATION,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
case 'notification.bookmark':
|
||||||
|
return {
|
||||||
|
payload: payload.action,
|
||||||
|
type: CHANGE_BOOKMARK_NOTIFICATION
|
||||||
|
}
|
||||||
|
|
||||||
case 'notification.reblog':
|
case 'notification.reblog':
|
||||||
return {
|
return {
|
||||||
payload: payload.action,
|
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_COMMENT_NOTIFICATION = 'CHANGE_COMMENT_NOTIFICATION';
|
||||||
export const CHANGE_MENTION_NOTIFICATION = 'CHANGE_MENTION_NOTIFICATION';
|
export const CHANGE_MENTION_NOTIFICATION = 'CHANGE_MENTION_NOTIFICATION';
|
||||||
export const CHANGE_FAVORITE_NOTIFICATION = 'CHANGE_FAVORITE_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_REBLOG_NOTIFICATION = 'CHANGE_REBLOG_NOTIFICATION';
|
||||||
export const CHANGE_TRANSFERS_NOTIFICATION = 'CHANGE_TRANSFERS_NOTIFICATION';
|
export const CHANGE_TRANSFERS_NOTIFICATION = 'CHANGE_TRANSFERS_NOTIFICATION';
|
||||||
export const CHANGE_ALL_NOTIFICATION_SETTINGS = 'CHANGE_ALL_NOTIFICATION_SETTINGS';
|
export const CHANGE_ALL_NOTIFICATION_SETTINGS = 'CHANGE_ALL_NOTIFICATION_SETTINGS';
|
||||||
|
@ -3,6 +3,7 @@ import {
|
|||||||
CHANGE_FOLLOW_NOTIFICATION,
|
CHANGE_FOLLOW_NOTIFICATION,
|
||||||
CHANGE_MENTION_NOTIFICATION,
|
CHANGE_MENTION_NOTIFICATION,
|
||||||
CHANGE_FAVORITE_NOTIFICATION,
|
CHANGE_FAVORITE_NOTIFICATION,
|
||||||
|
CHANGE_BOOKMARK_NOTIFICATION,
|
||||||
CHANGE_REBLOG_NOTIFICATION,
|
CHANGE_REBLOG_NOTIFICATION,
|
||||||
CHANGE_TRANSFERS_NOTIFICATION,
|
CHANGE_TRANSFERS_NOTIFICATION,
|
||||||
CHANGE_VOTE_NOTIFICATION,
|
CHANGE_VOTE_NOTIFICATION,
|
||||||
@ -186,6 +187,13 @@ export default function (state = initialState, action): State {
|
|||||||
favoriteNotification: action.payload,
|
favoriteNotification: action.payload,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
case CHANGE_BOOKMARK_NOTIFICATION:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
notificationDetails: {
|
||||||
|
...state.notificationDetails,
|
||||||
|
bookmarkNotification: action.payload,
|
||||||
|
},
|
||||||
|
});
|
||||||
case CHANGE_REBLOG_NOTIFICATION:
|
case CHANGE_REBLOG_NOTIFICATION:
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
notificationDetails: {
|
notificationDetails: {
|
||||||
|
@ -43,8 +43,8 @@ const persistConfig = {
|
|||||||
key: 'root',
|
key: 'root',
|
||||||
// Storage Method (React Native)
|
// Storage Method (React Native)
|
||||||
storage: AsyncStorage,
|
storage: AsyncStorage,
|
||||||
version: 1, // New version 0, default or previous version -1, versions are useful migrations
|
version: 2, // New version 0, default or previous version -1, versions are useful migrations
|
||||||
// Blacklist (Don't Save Specific Reducers)
|
// // Blacklist (Don't Save Specific Reducers)
|
||||||
blacklist: ['communities', 'user', 'ui'],
|
blacklist: ['communities', 'user', 'ui'],
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
transforms: [transformCacheVoteMap, transformWalkthroughMap],
|
transforms: [transformCacheVoteMap, transformWalkthroughMap],
|
||||||
|
@ -776,7 +776,7 @@ class ApplicationContainer extends Component {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
notify_types = [1, 2, 3, 4, 5, 6];
|
notify_types = [1, 2, 3, 4, 5, 6, 13, 15];
|
||||||
}
|
}
|
||||||
|
|
||||||
messaging()
|
messaging()
|
||||||
|
@ -216,6 +216,8 @@ class LoginContainer extends PureComponent {
|
|||||||
comment: 4,
|
comment: 4,
|
||||||
reblog: 5,
|
reblog: 5,
|
||||||
transfers: 6,
|
transfers: 6,
|
||||||
|
favorite: 13,
|
||||||
|
bookmark: 15,
|
||||||
};
|
};
|
||||||
const notifyTypes = [];
|
const notifyTypes = [];
|
||||||
|
|
||||||
@ -236,9 +238,11 @@ class LoginContainer extends PureComponent {
|
|||||||
system: `fcm-${Platform.OS}`,
|
system: `fcm-${Platform.OS}`,
|
||||||
allows_notify: Number(notificationSettings),
|
allows_notify: Number(notificationSettings),
|
||||||
notify_types: notifyTypes,
|
notify_types: notifyTypes,
|
||||||
|
|
||||||
};
|
};
|
||||||
setPushToken(data).then(() => {
|
setPushToken(data).then(() => {
|
||||||
setPushTokenSaved(true);
|
setPushTokenSaved(true);
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -173,6 +173,10 @@ const reduxMigrations = {
|
|||||||
state.application.notificationDetails.favoriteNotification = true;
|
state.application.notificationDetails.favoriteNotification = true;
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
|
2: (state) => {
|
||||||
|
state.application.notificationDetails.bookmarkNotification = true;
|
||||||
|
return state;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
Loading…
Reference in New Issue
Block a user