diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-04-08 19:01:40 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-04-08 19:01:40 +0000 |
| commit | 546ced43d9edbaf176f71b010aadc11bf7e5e851 (patch) | |
| tree | b198a3b47ecea40df33b072ff5576583ab722f22 /src/modules | |
| parent | 2f725c570b5567eb6d92f056f723b193529e3ffd (diff) | |
| parent | 6b6878bde06b375b1e715a3557f153acc73a8af0 (diff) | |
Merge branch 'moderation-menu' into 'develop'
Moderation menu #310
See merge request pleroma/pleroma-fe!595
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/statuses.js | 10 | ||||
| -rw-r--r-- | src/modules/users.js | 22 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 8e0203e3..4007b0fc 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -378,6 +378,13 @@ export const mutations = { const newStatus = state.allStatusesObject[status.id] newStatus.deleted = true }, + setManyDeleted (state, condition) { + Object.values(state.allStatusesObject).forEach(status => { + if (condition(status)) { + status.deleted = true + } + }) + }, setLoading (state, { timeline, value }) { state.timelines[timeline].loading = value }, @@ -438,6 +445,9 @@ const statuses = { commit('setDeleted', { status }) apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials }) }, + markStatusesAsDeleted ({ commit }, condition) { + commit('setManyDeleted', condition) + }, favorite ({ rootState, commit }, status) { // Optimistic favoriting... commit('setFavorited', { status, value: true }) diff --git a/src/modules/users.js b/src/modules/users.js index 1a507d31..5839574b 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -37,6 +37,28 @@ export const mutations = { const user = state.usersObject[id] set(user, 'muted', muted) }, + tagUser (state, { user: { id }, tag }) { + const user = state.usersObject[id] + const tags = user.tags || [] + const newTags = tags.concat([tag]) + set(user, 'tags', newTags) + }, + untagUser (state, { user: { id }, tag }) { + const user = state.usersObject[id] + const tags = user.tags || [] + const newTags = tags.filter(t => t !== tag) + set(user, 'tags', newTags) + }, + updateRight (state, { user: { id }, right, value }) { + const user = state.usersObject[id] + let newRights = user.rights + newRights[right] = value + set(user, 'rights', newRights) + }, + updateActivationStatus (state, { user: { id }, status }) { + const user = state.usersObject[id] + set(user, 'deactivated', !status) + }, setCurrentUser (state, user) { state.lastLoginName = user.screen_name state.currentUser = merge(state.currentUser || {}, user) |
