From 57ed3b8bf097fed5ccf222a2f79e816d9798bf1d Mon Sep 17 00:00:00 2001 From: gsovereignty Date: Mon, 30 Oct 2023 12:24:41 +0800 Subject: [PATCH] problem: repeated printing of problem to console --- src/components/problems/ProblemComponent.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/problems/ProblemComponent.svelte b/src/components/problems/ProblemComponent.svelte index 1cc5567..8a4d242 100644 --- a/src/components/problems/ProblemComponent.svelte +++ b/src/components/problems/ProblemComponent.svelte @@ -18,7 +18,9 @@ let openState: boolean; $: focusProblem = openState ? "problem focus-problem" : "problem"; - $: if (openState) { + let printed = new Map() + $: if (openState && !printed.get(problem.UID)) { + printed.set(problem.UID, true) console.log(problem) }