From e3fb4fcf4156ee539d07788cd0da30c5d51c35da Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 2 Jan 2024 17:34:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E4=B8=BAfalse=E6=97=B6,=20=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=90=AF=E5=8A=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 14 ++++++++------ package.json | 2 +- test/.httpserver | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index ec44e28..0ed717c 100644 --- a/index.js +++ b/index.js @@ -218,6 +218,8 @@ function createServer() { function __init__() { let folders = vsc.workspace.workspaceFolders + enabled = false + statItem.hide() if (folders && folders.length) { @@ -269,12 +271,12 @@ export function activate(ctx) { __init__() vsc.workspace.onDidSaveTextDocument(doc => { - if (enabled) { - let file = doc.fileName - if (file.startsWith(root)) { - if (basename(file) === CONFIG_FILE) { - return __init__() - } + let file = doc.fileName + if (file?.startsWith(root)) { + if (basename(file) === CONFIG_FILE) { + return __init__() + } + if (enabled) { ws.send() } } diff --git a/package.json b/package.json index 298a58c..dd6d3fe 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "simple-http", "displayName": "simple http.server", "description": "🔥 简单的http服务器, 方便临时调试html", - "version": "1.6.0", + "version": "1.6.1", "publisher": "yutent", "author": "Yutent [@yutent]", "icon": "logo.png", diff --git a/test/.httpserver b/test/.httpserver index 3cf1d27..d15a409 100644 --- a/test/.httpserver +++ b/test/.httpserver @@ -1,4 +1,4 @@ { - "enabled": true, + "enabled": false, "port": 9090 }