Skip to content
Merged

Dev #2701

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
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ $(function () {
let itemId = $(this).data('id');
let ownerId = $(this).data('ownerid');
let commentType = $(this).data('type');
pinComment(itemId, ownerId, commentType);

pinComment(itemId, ownerId, commentType, mentionDataList);
});

$('body').on('click', '.unpin-button', function (e) {
e.preventDefault();
let itemId = $(this).data('id');
let ownerId = $(this).data('ownerid');
let commentType = $(this).data('type');
unpinComment(itemId, ownerId, commentType);

unpinComment(itemId, ownerId, commentType, mentionDataList);
});
});

Expand Down Expand Up @@ -239,7 +239,7 @@ function deleteComment(commentId, ownerId, commentType) {
);
}

function pinComment(commentId, ownerId, commentType) {
function pinComment(commentId, ownerId, commentType, mentionList) {
abp.message.confirm(
'Are you sure you want to pin this comment?',
'Pin Comment',
Expand All @@ -250,8 +250,11 @@ function pinComment(commentId, ownerId, commentType) {
commentType: commentType
}).then(function () {
abp.notify.success('Comment pinned successfully');

PubSub.publish(commentType + '_refresh');
setTimeout(() => {
initTribute(mentionList);
}, 500);
}).catch(function (error) {
abp.notify.error('Failed to pin comment');
console.error(error);
Expand All @@ -261,14 +264,17 @@ function pinComment(commentId, ownerId, commentType) {
);
}

function unpinComment(commentId, ownerId, commentType) {
function unpinComment(commentId, ownerId, commentType, mentionList) {
unity.grantManager.comments.comment.unpin(commentId, {
ownerId: ownerId,
commentType: commentType
}).then(function () {
abp.notify.success('Comment unpinned successfully');

PubSub.publish(commentType + '_refresh');
setTimeout(() => {
initTribute(mentionList);
}, 500);
}).catch(function (error) {
abp.notify.error('Failed to unpin comment');
console.error(error);
Expand Down
Loading