Thank you,
After many many tries I prepared working extension of ‘discourse/views/topic-list-item’ and click(e) event:
if (target.hasClass('like-count') || target.parents('.like-count').length > 0) {
const topic = this.get('topic');
Discourse.ajax(`/posts/by_number/${topic.id}/1`).then(result => {
const post = Post.create(result);
if(post.user_id == Discourse.User.current().id){
bootbox.alert(I18n.t('cant_thumb_up'))
return false;
}
post.get('likeAction').togglePromise(post).then(resultLike => {
if(resultLike.acted) {
target.closest('.like-count').toggleClass('liked');
topic.like_count = topic.like_count+1;
target.closest('.like-count').find('span').text(topic.like_count);
}else{
target.closest('.like-count').removeClass('liked');
topic.like_count = topic.like_count-1;
target.closest('.like-count').find('span').text(topic.like_count);
}
})
});
return false;
}
+ CSS + view extension.
I know it’s not perfect solution but Base works very well.