Skip to content

Commit

Permalink
v0.9.3: bug fix: display "no comments" if there are only comments fro…
Browse files Browse the repository at this point in the history
…m other users
  • Loading branch information
adrienjoly committed Aug 17, 2017
1 parent c46cfa0 commit c1eaac9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trello-outliner-power-up",
"version": "0.9.2",
"version": "0.9.3",
"description": "Comment Editor by AJ: a Trello Power-Up that allows you to edit card comments using an Outliner.",
"homepage": "https://adrienjoly.com/trello-outliner",
"main": "server/server.js",
Expand Down
5 changes: 3 additions & 2 deletions public/js/comment-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ t.get('member', 'private', 'token')
t.remove('member', 'private', 'token'); // will cause auth popup to display on next click
return;
}
if (!res.comments.length) {
const comments = res.comments.filter(myOwnComment);
if (!comments.length) {
const p = document.createElement('p');
p.appendChild(document.createTextNode('Please add a comment to your card first. Then, you will be able to edit it by clicking this button again.'));
container.appendChild(p);
return;
}
res.comments.filter(myOwnComment).forEach(function(comment) {
comments.forEach(function(comment) {
const li = document.createElement('li');
li.appendChild(document.createTextNode(comment.data.text));
li.addEventListener('click', function(){
Expand Down

0 comments on commit c1eaac9

Please sign in to comment.