-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX]: Fix PR expand Feature #142
Conversation
while ((prLinkMatches = githubPRLinkRegex.exec(text)) !== null) { | ||
matches.push(prLinkMatches); | ||
} |
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 while loop is not making sense
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.
Hey @samad-yar-khan Actually We are using this loop to get all the possible PR links from the message.
This while loop iterates through the matches of the regular expression in the message text. It uses exec()
to find the next match in the text. As long as there is a match (!== null)
, it adds the match to the matches array.
and now that we have an array of all possible PR links we can check if its more then 3 let's not show a button or else add the button for Each PR.
@VipinDevelops Great improvement over the previous implementation, user experience feels cleaner ! |
I am glad you like this approach it took me some time to figure out the best alternative for this. |
await handleGitHubCodeSegmentLink(message, read, http, message.sender, message.room, extend); | ||
} | ||
|
||
if (await hasGithubPRLink(message)) { | ||
await handleGithubPRLinks(message, read, http, message.sender, message.room, extend); | ||
} |
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.
@VipinDevelops do you think adding more of these checks in checkPreMessageSentExtend will hinder performance ?
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.
LGTM, Thanks @VipinDevelops
Issue(s)
Acceptance Criteria Fulfillment
Proposed Changes (including videos or screenshots)
Screencast.from.2024-03-06.22-54-35.webm