From 158a4a65458bcc007c11ec6be9e74e433f996daa Mon Sep 17 00:00:00 2001 From: exyi Date: Sat, 17 Oct 2020 12:57:09 +0000 Subject: [PATCH] Fix invalid requests to fetch points for text tasks --- frontend/src/Graph.svelte | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index fa286fa..7da8b06 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -204,16 +204,19 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte"; $: { if (hoveredTask != null) { const status = $taskStatuses.get(hoveredTask.id); - if (status == null) { - const id = hoveredTask.id; - grabAssignment(hoveredTask.id).then(e => { - if (hoveredTask && hoveredTask.id == id) - tooltipMaxPoints = e.points; - }) - } else { + if (status) { tooltipMaxPoints = status.maxPoints; tooltipCurrPoints = status.points; } + else if (hoveredTask.type == 'open-data') { + const id = hoveredTask.id; + grabAssignment(hoveredTask.taskReference).then(e => { + if (hoveredTask?.id == id) { + tooltipMaxPoints = e.points + resizeTooltipBox() + } + }) + } resizeTooltipBox(); } else { tooltipMaxPoints = null;