From 566dcc78d36672d54b30f58ce5fe38c39e5447dc Mon Sep 17 00:00:00 2001 From: ITLDG Date: Sat, 4 Nov 2023 14:42:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=8F=8F=E8=BF=B0=E6=88=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E5=90=8E=E8=BF=98=E7=BB=A7=E7=BB=AD=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ package.json | 2 +- src/api/gistServer.ts | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1a8d8..0e3e596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ - 列表搜索代码片段 +## [0.0.10] - 2023-11-04 + +### Changed +- fix: 修复取消输入描述或文件名后还继续创建的问题 + ## [0.0.9] - 2023-04-26 ### Changed diff --git a/package.json b/package.json index e12ad55..97c6907 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "LdgGist", "publisher": "itldg", "description": "基于Gitee和GitHub的代码片段管理工具", - "version": "0.0.9", + "version": "0.0.10", "icon": "resources/logo.png", "engines": { "vscode": "^1.65.0" diff --git a/src/api/gistServer.ts b/src/api/gistServer.ts index ec686e6..c594e54 100644 --- a/src/api/gistServer.ts +++ b/src/api/gistServer.ts @@ -98,7 +98,9 @@ export default class GistServer { return; } const description = await window.showInputBox({ placeHolder: localize(`${EXTENSION_NAME}.gistDescription`) }) || ""; + if (description === "") return; const fileName = await window.showInputBox({ placeHolder: localize(`${EXTENSION_NAME}.fileName`) }) || ""; + if (fileName === "") return; const ispublic = await window.showInputBox({ placeHolder: localize(`${EXTENSION_NAME}.isPublic`) }) || ""; await this.create(description, fileName, edit.document.getText(edit.selection), ispublic); } @@ -115,6 +117,7 @@ export default class GistServer { return; } const description = await window.showInputBox({ placeHolder: localize(`${EXTENSION_NAME}.gistDescription`) }) || ""; + if (description === "") return; const ispublic = await window.showInputBox({ placeHolder: localize(`${EXTENSION_NAME}.isPublic`) }) || ""; await this.create(description, path.basename(filePath), content, ispublic); } catch (error) { @@ -132,6 +135,7 @@ export default class GistServer { return; } const fileName = await window.showInputBox({ placeHolder: localize(`${EXTENSION_NAME}.fileName`) }) || ""; + if (fileName === "") return; await this.add(fileName, edit.document.getText(edit.selection)); }