Skip to content
Snippets Groups Projects
Commit 6b7ed744 authored by syuilo's avatar syuilo
Browse files

Fix bug

parent 93140daf
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,13 @@ import * as mongo from 'mongodb';
import Subscription from '../models/sw-subscription';
import config from '../../conf';
push.setGCMAPIKey(config.sw.gcm_api_key);
if (config.sw) {
push.setGCMAPIKey(config.sw.gcm_api_key);
}
export default async function(userId: mongo.ObjectID | string, type, body?) {
if (!config.sw) return;
if (typeof userId === 'string') {
userId = new mongo.ObjectID(userId);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment