Feature: Add web push notification permission in frontend (#766)

Add webpush notification permission in frontend

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S
2020-05-06 00:10:56 +05:30
committed by GitHub
parent 5bd7a4c511
commit e9131ea558
37 changed files with 651 additions and 318 deletions

View File

@@ -17,6 +17,9 @@ export const getters = {
getSelectedEmailFlags: $state => {
return $state.record.selected_email_flags;
},
getSelectedPushFlags: $state => {
return $state.record.selected_push_flags;
},
};
export const actions = {
@@ -35,12 +38,13 @@ export const actions = {
}
},
update: async ({ commit }, params) => {
update: async ({ commit }, { selectedEmailFlags, selectedPushFlags }) => {
commit(types.default.SET_USER_NOTIFICATION_UI_FLAG, { isUpdating: true });
try {
const response = await UserNotificationSettings.update({
notification_settings: {
selected_email_flags: params,
selected_email_flags: selectedEmailFlags,
selected_push_flags: selectedPushFlags,
},
});
commit(types.default.SET_USER_NOTIFICATION, response.data);