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");
|
||||
}
|
||||
|
||||
try {
|
||||
switch (currentView) {
|
||||
case "dashboard":
|
||||
renderDashboard();
|
||||
@@ -2898,6 +2899,17 @@ function renderView() {
|
||||
default:
|
||||
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();
|
||||
}
|
||||
@@ -3202,8 +3214,8 @@ function handleSessionTimerTick() {
|
||||
function renderDashboard() {
|
||||
const active = getActiveSession();
|
||||
const schedule = getScheduleDriftSummary();
|
||||
const totalPassings = Object.values(state.resultsBySession).reduce(
|
||||
(sum, x) => sum + (x.passings?.length || 0),
|
||||
const totalPassings = Object.values(state.resultsBySession || {}).reduce(
|
||||
(sum, x) => sum + (x?.passings?.length || 0),
|
||||
0
|
||||
);
|
||||
const backendUrl = getBackendUrl();
|
||||
|
||||
Reference in New Issue
Block a user