-
Notifications
You must be signed in to change notification settings - Fork 384
Changing request review message to self when the same user #2558
Conversation
Huddie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stuff! Some nits.
|
|
||
| let styledString: StyledTextString | ||
| if actor == user { | ||
| styledString = IssueRequestModel.buildSelfString(actor: actor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline this like
buildSelfString(
actor: actor,
...
)
| date: date, | ||
| event: event) | ||
| } else { | ||
| styledString = IssueRequestModel.buildString(actor: actor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| ).warm(width: width) | ||
| } | ||
|
|
||
| static private func buildSelfString(actor: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline this (same as above)
function(
param1: ...,
param2 ...,
) -> return {
| return builder.build() | ||
| } | ||
|
|
||
| static private func buildString(actor: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| } | ||
|
|
||
| static private func buildSelfString(actor: String, | ||
| user: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user is never used inside this function so no need to pass it in. Instead of passing in actor you may want to pass in user and switch the use of actor later on to user. I think it reads better as user
|
|
||
| let image = UIImage(named: "chevron-down").withRenderingMode(.alwaysTemplate) | ||
| let optionButtonWidth = (image.size.width ?? 0) + (2 * Styles.Sizes.gutter) | ||
| let optionButtonWidth = image.size.width + (2 * Styles.Sizes.gutter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't relevant to this PR
| event: event) | ||
| } | ||
|
|
||
| self.string = StyledTextRenderer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You don't need self. here right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need, but I think is better for consistency since all other members being initialized require self. So doing all members even this with it :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They need self. because the parameter names match the variable names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but what I mean by consistency is
self.id = id
self.actor = actor
self.user = user
self.date = date
self.event = event
string = ... // Also a member
// Even it not needing, to maintain consistency in all memeber initialization
self.string = ... But can change if it is a problem :)
Hey guys :))
This is a simple improvement on the


IssueRequestchanging the message when the users are the same. The same message that appears on the GitHub web interface.From:
To:
Also, some warnings removed :)