Made it so edit will only be displayed for the user. Since its on client side (following practices used) a final check should be used when actually saving edit to db
This commit is contained in:
@ -22,8 +22,10 @@
|
|||||||
commentDetails = data;
|
commentDetails = data;
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
var editButton = "";
|
var editButton = "";
|
||||||
if ((Date.now() - commentDetails.commentOn) < 600000){
|
if (commentDetails.author.username === user.profile.username){
|
||||||
editButton = "<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='test-" + commentDetails._id + "'>Edit</a> · ";
|
if ((Date.now() - commentDetails.commentOn) < 600000){
|
||||||
|
editButton = "<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='test-" + commentDetails._id + "'>Edit</a> · ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$(div)
|
$(div)
|
||||||
.html(
|
.html(
|
||||||
|
Reference in New Issue
Block a user