Don't add empty source tag on a changeset

(closes #4993)
This commit is contained in:
Bryan Housel
2018-04-18 17:33:56 -04:00
parent a86167f0d1
commit d8f6fafe74
2 changed files with 27 additions and 27 deletions

View File

@@ -18,7 +18,7 @@ import { utilRebind } from '../util';
var _changeset;
var readOnlyTags = [
/^_changesets_count$/,
/^changesets_count$/,
/^created_by$/,
/^ideditor:/,
/^imagery_used$/,
@@ -65,7 +65,6 @@ export function uiCommit(context) {
var detected = utilDetect();
tags = {
comment: context.storage('comment') || '',
source: context.storage('source') || '',
created_by: ('iD ' + context.version).substr(0, 255),
host: detected.host.substr(0, 255),
locale: detected.locale.substr(0, 255)
@@ -80,6 +79,11 @@ export function uiCommit(context) {
tags.hashtags = hashtags;
}
var source = context.storage('source');
if (source) {
tags.source = source;
}
_changeset = new osmChangeset({ tags: tags });
}
@@ -293,9 +297,6 @@ export function uiCommit(context) {
}
}
if (changed.hasOwnProperty('source')) {
if (changed.source === undefined) {
changed.source = '';
}
if (!onInput) {
context.storage('source', changed.source);
context.storage('commentDate', Date.now());