summaryrefslogtreecommitdiffstats
path: root/src/store
diff options
context:
space:
mode:
authorJonas Sulzer <jonas@violoncello.ch>2019-04-23 20:47:45 +0200
committerMaxence Lange <maxence@artificial-owl.com>2019-05-03 16:31:15 -0100
commitd9c37be5eca33d8f0859b913403fd6b3ffe742be (patch)
treecb7846cbac67b002f6a5e22718158fc696591ad6 /src/store
parentcb408e8fb342d52604c336607dc9727b1b6f4de3 (diff)
👌 IMPROVE: immediate UI feedback / button change for successful boost/unboost
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
Diffstat (limited to 'src/store')
-rw-r--r--src/store/timeline.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/store/timeline.js b/src/store/timeline.js
index 050e620b..254c4ad7 100644
--- a/src/store/timeline.js
+++ b/src/store/timeline.js
@@ -99,6 +99,7 @@ const actions = {
postBoost(context, post) {
return new Promise((resolve, reject) => {
axios.post(OC.generateUrl(`apps/social/api/v1/post/boost?postId=${post.id}`)).then((response) => {
+ post.action.values.boosted = true
// eslint-disable-next-line no-console
console.log('Post boosted with token ' + response.data.result.token)
resolve(response)
@@ -112,6 +113,7 @@ const actions = {
postUnBoost(context, post) {
return axios.delete(OC.generateUrl(`apps/social/api/v1/post/boost?postId=${post.id}`)).then((response) => {
context.commit('removeBoost', post)
+ post.action.values.boosted = false
// eslint-disable-next-line no-console
console.log('Boost deleted with token ' + response.data.result.token)
}).catch((error) => {