From 5b93ee0f7a8265d57f30dea1e622c38af86c8573 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 30 Jan 2019 13:40:02 -0500 Subject: [PATCH] Run validation upon data restore after page reload --- modules/core/context.js | 4 ++++ modules/core/history.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/core/context.js b/modules/core/context.js index c41f772ae..b3f2eb6e1 100644 --- a/modules/core/context.js +++ b/modules/core/context.js @@ -459,6 +459,10 @@ export function coreContext() { issueManager = IssueManager(context); + // run validation upon restoring from page reload + history.on('restore', function() { + issueManager.validate(); + }); // re-run validation upon a significant graph change history.on('annotatedChange', function(difference) { if (difference) { diff --git a/modules/core/history.js b/modules/core/history.js index 0765bcb6e..16df09ae1 100644 --- a/modules/core/history.js +++ b/modules/core/history.js @@ -32,7 +32,7 @@ import { export function coreHistory(context) { - var dispatch = d3_dispatch('change', 'annotatedChange', 'merge', 'undone', 'redone'); + var dispatch = d3_dispatch('change', 'annotatedChange', 'merge', 'restore', 'undone', 'redone'); var lock = utilSessionMutex('lock'); var duration = 150; var _imageryUsed = []; @@ -625,6 +625,7 @@ export function coreHistory(context) { var json = context.storage(getKey('saved_history')); if (json) history.fromJSON(json, true); + dispatch.call('restore', this); },