Make agrument checking more robust

This commit is contained in:
James Allen 2018-05-30 12:48:08 +01:00
parent c5b553d4a6
commit e0e88b25fe

View file

@ -11,8 +11,8 @@ V1SubscriptionManager = require("./V1SubscriptionManager")
oneMonthInSeconds = 60 * 60 * 24 * 30
module.exports = FeaturesUpdater =
refreshFeatures: (user_id, notifyV1, callback)->
if !callback?
refreshFeatures: (user_id, notifyV1 = true, callback = () ->)->
if typeof notifyV1 == 'function'
callback = notifyV1
notifyV1 = true