kopia lustrzana https://github.com/nextcloud/social
Merge pull request #654 from StCyr/stCyr_fix653
refresh liked timeline when unliking a postpull/664/head
commit
0d05c00349
|
@ -97,6 +97,10 @@ export default {
|
|||
title: t('social', 'No global posts found'),
|
||||
description: t('social', 'Posts from federated instances will show up here')
|
||||
},
|
||||
liked: {
|
||||
image: 'img/undraw/profile.svg',
|
||||
title: t('social', 'No liked posts found')
|
||||
}
|
||||
tags: {
|
||||
image: 'img/undraw/profile.svg',
|
||||
title: t('social', 'No posts found for this tag')
|
||||
|
|
|
@ -133,8 +133,6 @@ const actions = {
|
|||
return new Promise((resolve, reject) => {
|
||||
axios.post(OC.generateUrl(`apps/social/api/v1/post/like?postId=${post.id}`)).then((response) => {
|
||||
context.commit('likePost', { post, parentAnnounce })
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Post liked with token ' + response.data.result.token)
|
||||
resolve(response)
|
||||
}).catch((error) => {
|
||||
OC.Notification.showTemporary('Failed to like post')
|
||||
|
@ -146,8 +144,10 @@ const actions = {
|
|||
postUnlike(context, { post, parentAnnounce }) {
|
||||
return axios.delete(OC.generateUrl(`apps/social/api/v1/post/like?postId=${post.id}`)).then((response) => {
|
||||
context.commit('unlikePost', { post, parentAnnounce })
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Post unliked with token ' + response.data.result.token)
|
||||
// Remove post from list if we are in the 'liked' timeline
|
||||
if (state.type === 'liked') {
|
||||
context.commit('removePost', post)
|
||||
}
|
||||
}).catch((error) => {
|
||||
OC.Notification.showTemporary('Failed to unlike post')
|
||||
console.error('Failed to unlike post', error)
|
||||
|
|
Ładowanie…
Reference in New Issue