Simple live moves

This commit is contained in:
2026-02-08 16:55:32 +01:00
parent f57fb22afc
commit d88dba2302
4 changed files with 88 additions and 2 deletions
+7 -1
View File
@@ -1,8 +1,10 @@
import * as vscode from "vscode";
import { addRun, submitRun } from "./client";
import { startMonitoring } from "./move";
export var currentRun: {
interval: NodeJS.Timeout;
monitorInterval: NodeJS.Timeout;
problemId: string;
start: Date;
id: string;
@@ -57,6 +59,7 @@ export async function startRun(
.toString()
.padStart(2, "0")}`;
}, 50),
monitorInterval: startMonitoring(runId),
};
await vscode.commands.executeCommand("setContext", "devrun.runActive", true);
@@ -64,8 +67,11 @@ export async function startRun(
export async function stopRun() {
if (currentRun) {
clearTimeout(currentRun.interval);
clearInterval(currentRun.interval);
clearInterval(currentRun.monitorInterval);
submitRun(currentRun.id);
currentRun = null;
}