Re-run validation automatically upon merging fetched remote data into the history

This commit is contained in:
Quincy Morgan
2019-01-29 11:10:12 -05:00
parent 2051dc4ca8
commit 226c4f88e1
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -465,6 +465,12 @@ export function coreContext() {
issueManager.validate();
}
});
// re-run validation upon merging fetched data
history.on('merge', function(entities) {
if (entities && entities.length > 0) {
issueManager.validate();
}
});
// Debounce save, since it's a synchronous localStorage write,
// and history changes can happen frequently (e.g. when dragging).
+2 -1
View File
@@ -32,7 +32,7 @@ import {
export function coreHistory(context) {
var dispatch = d3_dispatch('change', 'annotatedChange', 'undone', 'redone');
var dispatch = d3_dispatch('change', 'annotatedChange', 'merge', 'undone', 'redone');
var lock = utilSessionMutex('lock');
var duration = 150;
var _imageryUsed = [];
@@ -144,6 +144,7 @@ export function coreHistory(context) {
_tree.rebase(entities, false);
dispatch.call('change', this, undefined, extent);
dispatch.call('merge', this, entities);
},