提交 937fd582 编写于 作者: R Rachel Macfarlane

Small amount of code cleanup in commentNode.ts

上级 0e346590
......@@ -181,7 +181,7 @@ export class CommentNode extends Disposable {
let hasReactionHandler = this.commentService.hasReactionHandler(this.owner);
if (hasReactionHandler) {
let toggleReactionAction = this.createReactionPicker2(this.comment.commentReactions || []);
let toggleReactionAction = this.createReactionPicker(this.comment.commentReactions || []);
actions.push(toggleReactionAction);
}
......@@ -208,7 +208,7 @@ export class CommentNode extends Disposable {
actionViewItemProvider(action: Action) {
let options = {};
if (action.id === 'comment.delete' || action.id === 'comment.edit' || action.id === ToggleReactionsAction.ID) {
if (action.id === ToggleReactionsAction.ID) {
options = { label: false, icon: true };
} else {
options = { label: false, icon: true };
......@@ -226,7 +226,7 @@ export class CommentNode extends Disposable {
}
}
private createReactionPicker2(reactionGroup: modes.CommentReaction[]): ToggleReactionsAction {
private createReactionPicker(reactionGroup: modes.CommentReaction[]): ToggleReactionsAction {
let toggleReactionActionViewItem: DropdownMenuActionViewItem;
let toggleReactionAction = this._register(new ToggleReactionsAction(() => {
if (toggleReactionActionViewItem) {
......@@ -321,14 +321,8 @@ export class CommentNode extends Disposable {
});
if (hasReactionHandler) {
let toggleReactionAction = this.createReactionPicker2(this.comment.commentReactions || []);
let toggleReactionAction = this.createReactionPicker(this.comment.commentReactions || []);
this._reactionsActionBar.push(toggleReactionAction, { label: false, icon: true });
} else {
// let reactionGroup = this.commentService.getReactionGroup(this.owner);
// if (reactionGroup && reactionGroup.length) {
// let toggleReactionAction = this.createReactionPicker2(reactionGroup || []);
// this._reactionsActionBar.push(toggleReactionAction, { label: false, icon: true });
// }
}
}
......@@ -526,4 +520,4 @@ function fillInActions(groups: [string, Array<MenuItemAction | SubmenuItemAction
to.push(...actions);
}
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册