Skip to content

Commit bb7d4d5

Browse files
committed
🐛 修复vscode重连问题与某些情况下停止脚本无效的问题
1 parent 274ef59 commit bb7d4d5

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/app/service/system/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class SystemManager extends Manager {
149149
}
150150

151151
SystemConfig.hook.addListener("update", (key, val) => {
152-
if (key === "vscodeReconnect") {
152+
if (key === "vscode_reconnect") {
153153
if (val) {
154154
connectVSCodeTimer = setInterval(() => {
155155
handler();

src/pages/options/routes/ScriptList.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { ColumnProps } from "@arco-design/web-react/es/Table";
1717
import { ComponentsProps } from "@arco-design/web-react/es/Table/interface";
1818
import {
1919
Script,
20-
SCRIPT_RUN_STATUS_COMPLETE,
2120
SCRIPT_RUN_STATUS_RUNNING,
2221
SCRIPT_STATUS_DISABLE,
2322
SCRIPT_STATUS_ENABLE,
@@ -522,15 +521,6 @@ function ScriptList() {
522521
content: t("script_stopped"),
523522
duration: 3000,
524523
});
525-
setScriptList((list) => {
526-
for (let i = 0; i < list.length; i += 1) {
527-
if (list[i].id === item.id) {
528-
list[i].runStatus = SCRIPT_RUN_STATUS_COMPLETE;
529-
break;
530-
}
531-
}
532-
return [...list];
533-
});
534524
}}
535525
style={{
536526
color: "var(--color-text-2)",

src/runtime/content/sandbox.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ export default class SandboxRuntime {
106106
stop(scriptId: number): Promise<boolean> {
107107
const exec = this.execScripts.get(scriptId);
108108
if (!exec) {
109+
this.message.send("scriptRunStatus", [
110+
scriptId,
111+
SCRIPT_RUN_STATUS_COMPLETE,
112+
]);
109113
return Promise.resolve(false);
110114
}
111115
this.execStop(exec);

0 commit comments

Comments
 (0)