Skip to content

Commit

Permalink
Fix bug that breaks viewing groups w/o a location but location precis…
Browse files Browse the repository at this point in the history
…ion set to near
  • Loading branch information
tibetsprague committed Jun 21, 2022
1 parent 89a24c2 commit 2469648
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [4.1.4] - 2022-06-20

### Fixed
- Groups not displaying when they don't have a location but location obfuscation is set to something other than Precise

## [4.1.3] - 2022-06-15

### Added
Expand Down
17 changes: 10 additions & 7 deletions api/graphql/makeModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,18 @@ export default async function makeModels (userId, isAdmin, apiClient) {
return g.get('location')
} else {
const locObj = await g.locationObject().fetch()
let display = locObj.get('country')
if (locObj.get('region')) {
display = locObj.get('region') + ", " + display
}
if (locObj.get('city')) {
display = locObj.get('city') + ", " + display
if (locObj) {
let display = locObj.get('country')
if (locObj.get('region')) {
display = locObj.get('region') + ", " + display
}
if (locObj.get('city')) {
display = locObj.get('city') + ", " + display
}
return display
}
return display
}
return null
},
locationObject: async (g) => {
// If precision is precise or user is a moderator of the group show the exact location
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Tibet Sprague <tibet@hylo.com>",
"license": "GNU AFFERO GENERAL PUBLIC LICENSE v3",
"private": true,
"version": "4.1.3",
"version": "4.1.4",
"repository": {
"type": "git",
"url": "git://github.com/Hylozoic/hylo-node.git"
Expand Down

0 comments on commit 2469648

Please sign in to comment.