mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
More explicit handling of empty-string country-code
This commit is contained in:
parent
feee992b43
commit
7d81c42b9c
1 changed files with 3 additions and 1 deletions
|
@ -7,10 +7,12 @@ module.exports = AnalyticsController =
|
|||
updateEditingSession: (req, res, next) ->
|
||||
userId = AuthenticationController.getLoggedInUserId(req)
|
||||
projectId = req.params.projectId
|
||||
countryCode = null
|
||||
|
||||
if userId?
|
||||
GeoIpLookup.getDetails req.ip, (err, geoDetails) ->
|
||||
countryCode = geoDetails?.country_code || null
|
||||
if geoDetails?.country_code? and geoDetails.country_code != ""
|
||||
countryCode = geoDetails.country_code
|
||||
AnalyticsManager.updateEditingSession userId, projectId, countryCode, (error) ->
|
||||
respondWith(error, res, next)
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue