From 222e4f8e4b3c42b62fa5e23b0e20bd0e08a67a2a Mon Sep 17 00:00:00 2001 From: exyi Date: Sat, 17 Oct 2020 14:23:03 +0000 Subject: [PATCH] Use points from tasks.json removes annoying flashing of tooltip (and annoying network requests) fix #38 --- frontend/src/Graph.svelte | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index 7da8b06..dfd8dea 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -202,6 +202,8 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte"; tooltipBoxHeight = bbox.height + 5 + 5; } $: { + tooltipMaxPoints = null; + tooltipCurrPoints = null; if (hoveredTask != null) { const status = $taskStatuses.get(hoveredTask.id); if (status) { @@ -209,18 +211,9 @@ import TaskDetailEditor from "./TaskDetailEditor.svelte"; 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() - } - }) + tooltipMaxPoints = hoveredTask.points } resizeTooltipBox(); - } else { - tooltipMaxPoints = null; - tooltipCurrPoints = null; } };