1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-11 08:24:58 +01:00

fix: Replace timeline when fetch timeline at first

This commit is contained in:
AkiraFukushima 2018-03-24 01:31:39 +09:00
parent 657a21d402
commit 9c7225d493
2 changed files with 8 additions and 8 deletions

View File

@ -42,11 +42,11 @@ const TimelineSpace = {
appendNotifications (state, notifications) {
state.notifications = [notifications].concat(state.notifications)
},
insertHomeTimeline (state, messages) {
state.homeTimeline = state.homeTimeline.concat(messages)
updateHomeTimeline (state, messages) {
state.homeTimeline = messages
},
insertNotifications (state, notifications) {
state.notifications = state.notifications.concat(notifications)
updateNotifications (state, notifications) {
state.notifications = notifications
},
updateToot (state, message) {
// Replace target message in homeTimeline and notifications
@ -163,7 +163,7 @@ const TimelineSpace = {
)
client.get('/timelines/home', { limit: 40 }, (err, data, res) => {
if (err) return reject(err)
commit('insertHomeTimeline', data)
commit('updateHomeTimeline', data)
resolve(res)
})
})
@ -178,7 +178,7 @@ const TimelineSpace = {
)
client.get('/notifications', { limit: 30 }, (err, data, res) => {
if (err) return reject(err)
commit('insertNotifications', data)
commit('updateNotifications', data)
resolve(res)
})
})

View File

@ -6,7 +6,7 @@ const Favourites = {
favourites: []
},
mutations: {
insertFavourites (state, favourites) {
updateFavourites (state, favourites) {
state.favourites = favourites
},
updateToot (state, message) {
@ -37,7 +37,7 @@ const Favourites = {
)
client.get('/favourites', { limit: 40 }, (err, data, res) => {
if (err) return reject(err)
commit('insertFavourites', data)
commit('updateFavourites', data)
resolve(res)
})
})