Skip to content
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 comment not found #16

Merged
merged 3 commits into from
Sep 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions lib/freeze.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,9 @@ module.exports = class Freeze {
}

getLastFreeze(comments) {
let mainComment = {};
comments.reverse().some(comment => {
if (comment.user.login === this.config.probotUsername) {
mainComment = comment;
return true;
}
return false;
return comments.reverse().find(comment => {
return comment.user.login === this.config.probotUsername;
});
return mainComment;
}

freeze(context, props) {
Expand All @@ -57,7 +51,8 @@ module.exports = class Freeze {
}));

this.github.issues.createComment(context.issue({
body: 'Sure thing. I\'ll close this issue for a bit. I\'ll ping you around ' + props.unfreezeMoment.calendar() + ' :clock1: ' +
body: 'Sure thing. I\'ll close this issue for a bit. I\'ll ping you around ' +
moment(props.unfreezeMoment).calendar() + ' :clock1: ' +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually causing the tests to fail now because moment().calendar() returns the date as mm/dd/yyyy. I actually can't figure out how the tests were even passing before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. I just came back to this to try to fix it and the tests are actually passing. 😕

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. I'll run all this through again on master once the merges happen to make sure things are clean.

At the end of the day, we are 🔥 much of this to go to metadata anyway, so that should help

'<!-- ' + JSON.stringify(props) + '-->'
}));
}
Expand Down