diff --git a/comment-sample/package.json b/comment-sample/package.json index fbacf537..5b09027e 100644 --- a/comment-sample/package.json +++ b/comment-sample/package.json @@ -118,7 +118,7 @@ { "command": "mywiki.finishDraft", "group": "inline", - "when": "commentController == commment-sample && commentThread == draft" + "when": "commentController == comment-sample && commentThread == draft" } ], "comments/comment/title": [ diff --git a/comment-sample/src/extension.ts b/comment-sample/src/extension.ts index 485b4505..321db1df 100644 --- a/comment-sample/src/extension.ts +++ b/comment-sample/src/extension.ts @@ -54,12 +54,15 @@ export function activate(context: vscode.ExtensionContext) { return; } + thread.contextValue = undefined; thread.collapsibleState = vscode.CommentThreadCollapsibleState.Collapsed; - let newComment = new NoteComment(reply.text, vscode.CommentMode.Preview, { name: 'vscode' }, thread); - thread.comments = [...thread.comments, newComment].map(comment => { - comment.label = undefined; - return comment; - }); + if (reply.text) { + let newComment = new NoteComment(reply.text, vscode.CommentMode.Preview, { name: 'vscode' }, thread); + thread.comments = [...thread.comments, newComment].map(comment => { + comment.label = undefined; + return comment; + }); + } })); context.subscriptions.push(vscode.commands.registerCommand('mywiki.deleteNoteComment', (comment: NoteComment) => {