Simple live moves
This commit is contained in:
+7
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user