mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-07 11:51:35 +00:00
Fix an issue where stale missing tag errors could persist when canceling drawing a new way (close #5918)
Don't show missing tags error for a feature that is still being drawn (re: #5898)
This commit is contained in:
@@ -329,6 +329,9 @@ export function behaviorDrawWay(context, wayID, index, mode, startGraph, baselin
|
||||
}, 1000);
|
||||
var isNewFeature = !mode.isContinuing;
|
||||
context.enter(modeSelect(context, [wayID]).newFeature(isNewFeature));
|
||||
if (isNewFeature) {
|
||||
context.validator().validate();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { t } from '../util/locale';
|
||||
import { behaviorDrawWay } from '../behavior';
|
||||
|
||||
|
||||
export function modeDrawArea(context, wayId, startGraph, baselineGraph) {
|
||||
export function modeDrawArea(context, wayID, startGraph, baselineGraph) {
|
||||
var mode = {
|
||||
button: 'area',
|
||||
id: 'draw-area'
|
||||
@@ -10,11 +10,12 @@ export function modeDrawArea(context, wayId, startGraph, baselineGraph) {
|
||||
|
||||
var behavior;
|
||||
|
||||
mode.wayID = wayID;
|
||||
|
||||
mode.enter = function() {
|
||||
var way = context.entity(wayId);
|
||||
var way = context.entity(wayID);
|
||||
|
||||
behavior = behaviorDrawWay(context, wayId, undefined, mode, startGraph, baselineGraph)
|
||||
behavior = behaviorDrawWay(context, wayID, undefined, mode, startGraph, baselineGraph)
|
||||
.tail(t('modes.draw_area.tail'));
|
||||
|
||||
var addNode = behavior.addNode;
|
||||
@@ -40,7 +41,7 @@ export function modeDrawArea(context, wayId, startGraph, baselineGraph) {
|
||||
|
||||
|
||||
mode.selectedIDs = function() {
|
||||
return [wayId];
|
||||
return [wayID];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ export function modeDrawLine(context, wayID, startGraph, baselineGraph, affix, c
|
||||
|
||||
var behavior;
|
||||
|
||||
mode.wayID = wayID;
|
||||
|
||||
mode.isContinuing = continuing;
|
||||
|
||||
mode.enter = function() {
|
||||
|
||||
@@ -29,6 +29,14 @@ export function validationMissingTag() {
|
||||
return [];
|
||||
}
|
||||
|
||||
var mode = context.mode();
|
||||
if (entity.type === 'way' && mode &&
|
||||
(mode.id === 'draw-area' || (mode.id === 'draw-line' && !mode.isContinuing)) &&
|
||||
mode.wayID === entity.id) {
|
||||
// don't flag missing tag issues if drawing a new way
|
||||
return [];
|
||||
}
|
||||
|
||||
var messageObj = {};
|
||||
var missingTagType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user