filter validations early in history

Follow @wonga00's comment in https://github.com/openstreetmap/iD/pull/5627
This commit is contained in:
Xiaoming Gao
2018-12-19 12:05:02 -05:00
parent a05e259628
commit c1e3a7396f
+2 -1
View File
@@ -40,6 +40,7 @@ export function coreHistory(context) {
var _stack;
var _index;
var _tree;
var validations = _filter(Validations, _isFunction);
// internal _act, accepts list of actions and eased time
@@ -282,7 +283,7 @@ export function coreHistory(context) {
validate: function(changes) {
return _flatten(_map(
_filter(Validations, _isFunction),
validations,
function(fn) {
return fn(context)(changes, _stack[_index].graph);
}