mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
Store changesets_count in a changeset tag
(it will say "0" for someone making their first edit)
This commit is contained in:
@@ -11,11 +11,18 @@ import { utilRebind } from '../util';
|
||||
|
||||
|
||||
var changeset;
|
||||
var readOnlyTags = ['created_by', 'imagery_used', 'host', 'locale'];
|
||||
var readOnlyTags = [
|
||||
'changesets_count',
|
||||
'created_by',
|
||||
'imagery_used',
|
||||
'host',
|
||||
'locale'
|
||||
];
|
||||
|
||||
|
||||
export function uiCommit(context) {
|
||||
var dispatch = d3.dispatch('cancel', 'save'),
|
||||
userDetails,
|
||||
_selection;
|
||||
|
||||
var changesetEditor = uiChangesetEditor(context)
|
||||
@@ -122,6 +129,8 @@ export function uiCommit(context) {
|
||||
|
||||
var userLink = d3.select(document.createElement('div'));
|
||||
|
||||
userDetails = user;
|
||||
|
||||
if (user.image_url) {
|
||||
userLink
|
||||
.append('img')
|
||||
@@ -323,6 +332,13 @@ export function uiCommit(context) {
|
||||
}
|
||||
}
|
||||
|
||||
// always update userdetails, just in case user reauthenticates as someone else
|
||||
if (userDetails && userDetails.changesets_count !== undefined) {
|
||||
tags.changesets_count = String(userDetails.changesets_count);
|
||||
} else {
|
||||
delete tags.changesets_count;
|
||||
}
|
||||
|
||||
if (!_.isEqual(changeset.tags, tags)) {
|
||||
changeset = changeset.update({ tags: tags });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user