Skip to content

Commit

Permalink
Add an ability to show only anonymous notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ENT8R committed Jan 3, 2019
1 parent 6bc06be commit 074153b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const Request = (function() {
};
if (query) data.q = query;
if (bbox) data.bbox = query;
if (user) data.display_name = user; // eslint-disable-line camelcase
if (user && !['anonymous', Localizer.getMessage('note.anonymous')].includes(user)) data.display_name = user; // eslint-disable-line camelcase
if (from) data.from = from;
if (to) data.to = to;

Expand Down
11 changes: 7 additions & 4 deletions js/expert.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ const Expert = (function() { // eslint-disable-line no-unused-vars

for (let i = 0; i < result.features.length; i++) {
const feature = result.features[i];
if (ids.indexOf(feature.properties.id) === -1) {
const note = feature.properties;
const comment = note.comments[0];
const geometry = feature.geometry;

const note = feature.properties;
const geometry = feature.geometry;
const comment = note.comments[0];
if (ids.indexOf(note.id) === -1) {
if (['anonymous', Localizer.getMessage('note.anonymous')].includes(user) && typeof comment.user !== 'undefined') {
continue;
}
ids.push(note.id);
notes.push({
id: note.id,
Expand Down

0 comments on commit 074153b

Please sign in to comment.