Skip to content

Commit

Permalink
fix: remove interval on admin page
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Lauber <[email protected]>
  • Loading branch information
janlauber committed Nov 5, 2023
1 parent a58c908 commit 11178e9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions kubelab-ui/src/routes/admin/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
TableHeadCell
} from "flowbite-svelte";
import { CheckCircle, HelpCircle, Play } from "lucide-svelte";
import { onDestroy, onMount } from "svelte";
import { onMount } from "svelte";
import toast from "svelte-french-toast";
interface Activity {
Expand Down Expand Up @@ -286,13 +286,6 @@
await getAllExerciseSessions();
await getCompany();
// set an interval to get the exercise_session_logs every 5 seconds
setInterval(async () => {
await getExerciseSessionLogs();
await getNotifications();
await getAllExerciseSessions();
}, 10000);
// watch for new notifications and post them to the notifications array
client.collection("notifications").subscribe("*", function (e) {
if (e.action === "create") {
Expand All @@ -305,11 +298,6 @@
});
});
onDestroy(() => {
// clear the interval when the component is destroyed
setInterval(() => {});
});
function parseLogToActivity(log: any) {
let activity: Activity = {
exercise_title: log.expand.exercise_session.expand.exercise.title,
Expand Down

0 comments on commit 11178e9

Please sign in to comment.