mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-19 22:41:45 +02:00
fix(control-plane): restore accepted view after render failure
Preserve contributor history and current-main behavior while resolving the exact reviewed follow-up.
Source-PR: https://github.com/affaan-m/ECC/pull/3243
Source-Parent: cfe6d90d9f
Review-Manifest-SHA256: 78e13c4fe9581ef82100bb721f9b80ab8e62a15371e89b5f32c42c593944552b
This commit is contained in:
@@ -281,8 +281,23 @@ function renderControlPlaneViewHtml() {
|
||||
!Number.isFinite(data.thresholds.ta) || !Number.isFinite(data.thresholds.ra)) {
|
||||
throw new Error('Invalid control-plane view');
|
||||
}
|
||||
var previous = view;
|
||||
var drawStarted = false;
|
||||
view = Object.assign({}, data);
|
||||
renderEvents(); renderLanes(); draw();
|
||||
try {
|
||||
renderEvents(); renderLanes();
|
||||
drawStarted = true;
|
||||
draw();
|
||||
} catch (error) {
|
||||
view = previous;
|
||||
try {
|
||||
renderEvents(); renderLanes();
|
||||
if (drawStarted) draw();
|
||||
} catch (_) {
|
||||
// Keep the accepted model even if the DOM cannot be restored.
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
var c = view.counts || {};
|
||||
var summary = (c.tasks || 0) + ' tasks in ' + (c.lanes || 0) + ' lanes, ' +
|
||||
(c.advisories || 0) + ' advisories, ' + (c.resolutions || 0) + ' steering. ' +
|
||||
|
||||
Reference in New Issue
Block a user