fix render
This commit is contained in:
16
src/app.js
16
src/app.js
@@ -2861,6 +2861,7 @@ function renderView() {
|
|||||||
themeLabel.textContent = t("ui.theme");
|
themeLabel.textContent = t("ui.theme");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
switch (currentView) {
|
switch (currentView) {
|
||||||
case "dashboard":
|
case "dashboard":
|
||||||
renderDashboard();
|
renderDashboard();
|
||||||
@@ -2898,6 +2899,17 @@ function renderView() {
|
|||||||
default:
|
default:
|
||||||
renderDashboard();
|
renderDashboard();
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("renderView failed", error);
|
||||||
|
dom.view.innerHTML = `
|
||||||
|
<section class="panel">
|
||||||
|
<div class="panel-header"><h3>Render error</h3></div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<p>${escapeHtml(error instanceof Error ? error.message : String(error))}</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
updateHeaderState();
|
updateHeaderState();
|
||||||
}
|
}
|
||||||
@@ -3202,8 +3214,8 @@ function handleSessionTimerTick() {
|
|||||||
function renderDashboard() {
|
function renderDashboard() {
|
||||||
const active = getActiveSession();
|
const active = getActiveSession();
|
||||||
const schedule = getScheduleDriftSummary();
|
const schedule = getScheduleDriftSummary();
|
||||||
const totalPassings = Object.values(state.resultsBySession).reduce(
|
const totalPassings = Object.values(state.resultsBySession || {}).reduce(
|
||||||
(sum, x) => sum + (x.passings?.length || 0),
|
(sum, x) => sum + (x?.passings?.length || 0),
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
const backendUrl = getBackendUrl();
|
const backendUrl = getBackendUrl();
|
||||||
|
|||||||
Reference in New Issue
Block a user