Skip to content

Commit

Permalink
fix: 修复取消输入描述或文件名后还继续创建的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
itldg committed Nov 4, 2023
1 parent db7be98 commit 566dcc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

- 列表搜索代码片段

## [0.0.10] - 2023-11-04

### Changed
- fix: 修复取消输入描述或文件名后还继续创建的问题

## [0.0.9] - 2023-04-26

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions src/api/gistServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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) {
Expand All @@ -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));
}

Expand Down

0 comments on commit 566dcc7

Please sign in to comment.