From 2ff70f3fffdba5d14881166a9852131cc0255381 Mon Sep 17 00:00:00 2001 From: exyi Date: Sun, 18 Oct 2020 08:01:23 +0000 Subject: [PATCH] Fixed loading of points when logged in --- frontend/src/ksp-task-grabber.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/ksp-task-grabber.ts b/frontend/src/ksp-task-grabber.ts index e0824e3..bdaf5c1 100644 --- a/frontend/src/ksp-task-grabber.ts +++ b/frontend/src/ksp-task-grabber.ts @@ -160,8 +160,11 @@ function parseTaskStatuses(doc: HTMLDocument): TaskStatus[] { const pointsStr = r.cells[4].textContent!.trim() const pointsMatch = /((–|\.|\d)+) *\/ *(\d+)/.exec(pointsStr) if (!pointsMatch) throw new Error() - const points = +pointsMatch[1] - const maxPoints = +pointsMatch[2] + let points = +pointsMatch[2] + if (isNaN(points)) { + points = 0 + } + const maxPoints = +pointsMatch[3] const solved = r.classList.contains("zs-submitted") return { id, name, submitted, type, points, maxPoints, solved } })