Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 8178f40

Browse files
Changing using comparison
1 parent 6451937 commit 8178f40

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

src/GitHub.InlineReviews/ViewModels/CommentViewModel.cs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,14 @@ protected CommentViewModel(
6262

6363
var canDelete = this.WhenAnyValue(
6464
x => x.EditState,
65-
x =>
66-
{
67-
var sameUser = user.Equals(currentUser);
68-
var result = x == CommentEditState.None && sameUser;
69-
70-
log.Debug("CanDelete CommentEditState: {CommentEditState} SameUser: {SameUser} CanDelete:{CanDelete}", x, sameUser, result);
71-
72-
return result;
73-
});
65+
x => x == CommentEditState.None && user.Login.Equals(currentUser.Login));
7466

7567
Delete = ReactiveCommand.Create(canDelete);
7668

7769
var canEdit = this.WhenAnyValue(
7870
x => x.EditState,
79-
x =>
80-
{
81-
var sameUser = user.Equals(currentUser);
82-
var result = x == CommentEditState.Placeholder ||
83-
(x == CommentEditState.None && sameUser);
84-
85-
log.Debug("CanEdit CommentEditState: {CommentEditState} SameUser: {SameUser} CanEdit:{CanEdit}", x, sameUser, result);
86-
87-
return result;
88-
});
71+
x => x == CommentEditState.Placeholder ||
72+
(x == CommentEditState.None && user.Login.Equals(currentUser.Login)));
8973

9074
BeginEdit = ReactiveCommand.Create(canEdit);
9175
BeginEdit.Subscribe(DoBeginEdit);

0 commit comments

Comments
 (0)