aboutsummaryrefslogtreecommitdiff
path: root/src/modules/users.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2022-03-31 17:45:29 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2022-03-31 17:45:29 +0000
commitf71f101fce21ec053d46556928393a5f05f16239 (patch)
tree7b880c9c76502c57d455e81a8477e273d8178049 /src/modules/users.js
parent1d1ea7e703891ec48dfcbd2fc8090656cef1e36a (diff)
parentafdc61b9b7088f5d9880a4a8466461bd8c5aeb78 (diff)
Merge branch 'vue3-again' into 'develop'
Migration to Vue 3 (again) See merge request pleroma/pleroma-fe!1385
Diffstat (limited to 'src/modules/users.js')
-rw-r--r--src/modules/users.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/modules/users.js b/src/modules/users.js
index 05ff44d5..e5889fdb 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -1,7 +1,6 @@
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
import oauthApi from '../services/new_api/oauth.js'
import { compact, map, each, mergeWith, last, concat, uniq, isArray } from 'lodash'
-import { set } from 'vue'
import { registerPushNotifications, unregisterPushNotifications } from '../services/push/push.js'
// TODO: Unify with mergeOrAdd in statuses.js
@@ -15,9 +14,9 @@ export const mergeOrAdd = (arr, obj, item) => {
} else {
// This is a new item, prepare it
arr.push(item)
- set(obj, item.id, item)
+ obj[item.id] = item
if (item.screen_name && !item.screen_name.includes('@')) {
- set(obj, item.screen_name.toLowerCase(), item)
+ obj[item.screen_name.toLowerCase()] = item
}
return { item, new: true }
}
@@ -103,23 +102,23 @@ export const mutations = {
const user = state.usersObject[id]
const tags = user.tags || []
const newTags = tags.concat([tag])
- set(user, 'tags', newTags)
+ 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)
+ 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)
+ user['rights'] = newRights
},
updateActivationStatus (state, { user: { id }, deactivated }) {
const user = state.usersObject[id]
- set(user, 'deactivated', deactivated)
+ user['deactivated'] = deactivated
},
setCurrentUser (state, user) {
state.lastLoginName = user.screen_name
@@ -148,26 +147,26 @@ export const mutations = {
clearFriends (state, userId) {
const user = state.usersObject[userId]
if (user) {
- set(user, 'friendIds', [])
+ user['friendIds'] = []
}
},
clearFollowers (state, userId) {
const user = state.usersObject[userId]
if (user) {
- set(user, 'followerIds', [])
+ user['followerIds'] = []
}
},
addNewUsers (state, users) {
each(users, (user) => {
if (user.relationship) {
- set(state.relationships, user.relationship.id, user.relationship)
+ state.relationships[user.relationship.id] = user.relationship
}
mergeOrAdd(state.users, state.usersObject, user)
})
},
updateUserRelationship (state, relationships) {
relationships.forEach((relationship) => {
- set(state.relationships, relationship.id, relationship)
+ state.relationships[relationship.id] = relationship
})
},
saveBlockIds (state, blockIds) {
@@ -222,7 +221,7 @@ export const mutations = {
},
setColor (state, { user: { id }, highlighted }) {
const user = state.usersObject[id]
- set(user, 'highlight', highlighted)
+ user['highlight'] = highlighted
},
signUpPending (state) {
state.signUpPending = true