Merge branch 'develop' into 'fix-move-type-notification'
# Conflicts: # static/fontello.json
This commit is contained in:
commit
215662afde
54 changed files with 1548 additions and 982 deletions
|
@ -38,6 +38,7 @@ export const defaultState = () => ({
|
|||
notifications: emptyNotifications(),
|
||||
favorites: new Set(),
|
||||
error: false,
|
||||
errorData: null,
|
||||
timelines: {
|
||||
mentions: emptyTl(),
|
||||
public: emptyTl(),
|
||||
|
@ -483,6 +484,9 @@ export const mutations = {
|
|||
setError (state, { value }) {
|
||||
state.error = value
|
||||
},
|
||||
setErrorData (state, { value }) {
|
||||
state.errorData = value
|
||||
},
|
||||
setNotificationsLoading (state, { value }) {
|
||||
state.notifications.loading = value
|
||||
},
|
||||
|
@ -532,6 +536,9 @@ const statuses = {
|
|||
setError ({ rootState, commit }, { value }) {
|
||||
commit('setError', { value })
|
||||
},
|
||||
setErrorData ({ rootState, commit }, { value }) {
|
||||
commit('setErrorData', { value })
|
||||
},
|
||||
setNotificationsLoading ({ rootState, commit }, { value }) {
|
||||
commit('setNotificationsLoading', { value })
|
||||
},
|
||||
|
@ -555,45 +562,45 @@ const statuses = {
|
|||
favorite ({ rootState, commit }, status) {
|
||||
// Optimistic favoriting...
|
||||
commit('setFavorited', { status, value: true })
|
||||
rootState.api.backendInteractor.favorite(status.id)
|
||||
rootState.api.backendInteractor.favorite({ id: status.id })
|
||||
.then(status => commit('setFavoritedConfirm', { status, user: rootState.users.currentUser }))
|
||||
},
|
||||
unfavorite ({ rootState, commit }, status) {
|
||||
// Optimistic unfavoriting...
|
||||
commit('setFavorited', { status, value: false })
|
||||
rootState.api.backendInteractor.unfavorite(status.id)
|
||||
rootState.api.backendInteractor.unfavorite({ id: status.id })
|
||||
.then(status => commit('setFavoritedConfirm', { status, user: rootState.users.currentUser }))
|
||||
},
|
||||
fetchPinnedStatuses ({ rootState, dispatch }, userId) {
|
||||
rootState.api.backendInteractor.fetchPinnedStatuses(userId)
|
||||
rootState.api.backendInteractor.fetchPinnedStatuses({ id: userId })
|
||||
.then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId, showImmediately: true, noIdUpdate: true }))
|
||||
},
|
||||
pinStatus ({ rootState, dispatch }, statusId) {
|
||||
return rootState.api.backendInteractor.pinOwnStatus(statusId)
|
||||
return rootState.api.backendInteractor.pinOwnStatus({ id: statusId })
|
||||
.then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
||||
},
|
||||
unpinStatus ({ rootState, dispatch }, statusId) {
|
||||
rootState.api.backendInteractor.unpinOwnStatus(statusId)
|
||||
rootState.api.backendInteractor.unpinOwnStatus({ id: statusId })
|
||||
.then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
||||
},
|
||||
muteConversation ({ rootState, commit }, statusId) {
|
||||
return rootState.api.backendInteractor.muteConversation(statusId)
|
||||
return rootState.api.backendInteractor.muteConversation({ id: statusId })
|
||||
.then((status) => commit('setMutedStatus', status))
|
||||
},
|
||||
unmuteConversation ({ rootState, commit }, statusId) {
|
||||
return rootState.api.backendInteractor.unmuteConversation(statusId)
|
||||
return rootState.api.backendInteractor.unmuteConversation({ id: statusId })
|
||||
.then((status) => commit('setMutedStatus', status))
|
||||
},
|
||||
retweet ({ rootState, commit }, status) {
|
||||
// Optimistic retweeting...
|
||||
commit('setRetweeted', { status, value: true })
|
||||
rootState.api.backendInteractor.retweet(status.id)
|
||||
rootState.api.backendInteractor.retweet({ id: status.id })
|
||||
.then(status => commit('setRetweetedConfirm', { status: status.retweeted_status, user: rootState.users.currentUser }))
|
||||
},
|
||||
unretweet ({ rootState, commit }, status) {
|
||||
// Optimistic unretweeting...
|
||||
commit('setRetweeted', { status, value: false })
|
||||
rootState.api.backendInteractor.unretweet(status.id)
|
||||
rootState.api.backendInteractor.unretweet({ id: status.id })
|
||||
.then(status => commit('setRetweetedConfirm', { status, user: rootState.users.currentUser }))
|
||||
},
|
||||
queueFlush ({ rootState, commit }, { timeline, id }) {
|
||||
|
@ -608,19 +615,19 @@ const statuses = {
|
|||
},
|
||||
fetchFavsAndRepeats ({ rootState, commit }, id) {
|
||||
Promise.all([
|
||||
rootState.api.backendInteractor.fetchFavoritedByUsers(id),
|
||||
rootState.api.backendInteractor.fetchRebloggedByUsers(id)
|
||||
rootState.api.backendInteractor.fetchFavoritedByUsers({ id }),
|
||||
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
|
||||
]).then(([favoritedByUsers, rebloggedByUsers]) => {
|
||||
commit('addFavs', { id, favoritedByUsers, currentUser: rootState.users.currentUser })
|
||||
commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser })
|
||||
})
|
||||
},
|
||||
fetchFavs ({ rootState, commit }, id) {
|
||||
rootState.api.backendInteractor.fetchFavoritedByUsers(id)
|
||||
rootState.api.backendInteractor.fetchFavoritedByUsers({ id })
|
||||
.then(favoritedByUsers => commit('addFavs', { id, favoritedByUsers, currentUser: rootState.users.currentUser }))
|
||||
},
|
||||
fetchRepeats ({ rootState, commit }, id) {
|
||||
rootState.api.backendInteractor.fetchRebloggedByUsers(id)
|
||||
rootState.api.backendInteractor.fetchRebloggedByUsers({ id })
|
||||
.then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))
|
||||
},
|
||||
search (store, { q, resolve, limit, offset, following }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue