Skip to content

Commit 6cbeb78

Browse files
authored
Merge pull request #62 from demokratie-live/sprint#11/disable_push_notifications
Sprint#11/disable push notifications
2 parents e56f903 + 8de50bf commit 6cbeb78

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### 0.1.5
4+
5+
* pushNotifications
6+
* Disabled pushNotifications due to non-functionality
7+
38
### 0.1.4
49

510
* graphQL

src/services/notifications/index.js

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
/* eslint no-underscore-dangle: ["error", { "allow": ["_id"] }] */
22

3-
import _ from 'lodash';
4-
import apn from 'apn';
5-
import gcm from 'node-gcm';
6-
import util from 'util';
3+
// import _ from 'lodash';
4+
// import apn from 'apn';
5+
// import gcm from 'node-gcm';
6+
// import util from 'util';
77

8-
import apnProvider from './apn';
9-
import gcmProvider from './gcm';
8+
// import apnProvider from './apn';
9+
// import gcmProvider from './gcm';
1010
import UserModel from '../../models/User';
1111
import ProcedureModel from '../../models/Procedure';
12-
import CONFIG from '../../config/constants';
12+
// import CONFIG from '../../config/constants';
1313

14-
const sendNotifications = ({ tokenObjects, message }) => {
15-
const androidNotificationTokens = [];
14+
// TODO: remove both eslint-disable-line
15+
const sendNotifications = ({ tokenObjects, message }) => { // eslint-disable-line
16+
// Disable Push Notifications
17+
return; // eslint-disable-line
18+
/* const androidNotificationTokens = [];
1619
tokenObjects.forEach(({ token, os }) => {
1720
switch (os) {
1821
case 'ios':
@@ -56,7 +59,7 @@ const sendNotifications = ({ tokenObjects, message }) => {
5659
else console.log('gcmProvider', response);
5760
},
5861
);
59-
}
62+
} */
6063
};
6164

6265
const newVote = async ({ procedureId }) => {
@@ -106,8 +109,13 @@ const procedureUpdate = async ({ procedureId }) => {
106109

107110
export { procedureUpdate, newVote, newPreperation };
108111

109-
export default async ({ message, user }) => {
110-
let userId;
112+
// TODO: remove both eslint-disable-line
113+
export default async ({ message, user }) => { // eslint-disable-line
114+
// Disable Push Notifications
115+
return; // eslint-disable-line
116+
// This function seems to be (partly) a duplicate of the sendNotifications function
117+
// refactor?
118+
/* let userId;
111119
if (_.isObject(user)) {
112120
userId = user._id;
113121
}
@@ -158,5 +166,5 @@ export default async ({ message, user }) => {
158166
},
159167
);
160168
}
161-
}
169+
} */
162170
};

0 commit comments

Comments
 (0)