diff options
| author | Henry Jameson <me@hjkos.com> | 2019-09-08 13:44:29 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-09-08 13:44:29 +0300 |
| commit | db086fe1fdeefdc904f51ee00b2710f089996599 (patch) | |
| tree | 6e4734fc99544da9b34c78700b18c9b02a3f573f /src/modules/users.js | |
| parent | 5851f97eb058b3e2df91f9122ba899bc7e4affaf (diff) | |
| parent | e75ac9ddbc66a7e3cd40ef130b26b06b8cec9f1d (diff) | |
Merge remote-tracking branch 'upstream/develop' into emoji-selector-update
* upstream/develop: (116 commits)
Password reset page
add a comment
force img updating immediately
Fixed "sequimiento" to "seguimiento".
Replace `/api/externalprofile/show.json` with a MastoAPI equialent
Use mastodon api in follow requests
"Optional" in lowercase.
Update es.json
fix pin/unpin status logic
rename a mutation
update
fix user avatar fallback logic
remove dead code
Corrected "Media Proxy" translation.
Update es.json
make bio textarea resizable vertically only
remove dead code
Make image orientation consistent on FF, fix videos w/ modal
remove dead code
fix crazy watch logic in conversation
...
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 57d3a3e3..4d02f8d7 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -3,7 +3,6 @@ import oauthApi from '../services/new_api/oauth.js' import { compact, map, each, merge, last, concat, uniq } from 'lodash' import { set } from 'vue' import { registerPushNotifications, unregisterPushNotifications } from '../services/push/push.js' -import { humanizeErrors } from './errors' // TODO: Unify with mergeOrAdd in statuses.js export const mergeOrAdd = (arr, obj, item) => { @@ -165,13 +164,13 @@ export const mutations = { state.currentUser.muteIds.push(muteId) } }, - setPinned (state, status) { + setPinnedToUser (state, status) { const user = state.usersObject[status.user.id] - const index = user.pinnedStatuseIds.indexOf(status.id) + const index = user.pinnedStatusIds.indexOf(status.id) if (status.pinned && index === -1) { - user.pinnedStatuseIds.push(status.id) + user.pinnedStatusIds.push(status.id) } else if (!status.pinned && index !== -1) { - user.pinnedStatuseIds.splice(index, 1) + user.pinnedStatusIds.splice(index, 1) } }, setUserForStatus (state, status) { @@ -339,13 +338,13 @@ const users = { // Reconnect users to statuses store.commit('setUserForStatus', status) // Set pinned statuses to user - store.commit('setPinned', status) + store.commit('setPinnedToUser', status) }) each(compact(map(statuses, 'retweeted_status')), (status) => { // Reconnect users to retweets store.commit('setUserForStatus', status) // Set pinned retweets to user - store.commit('setPinned', status) + store.commit('setPinnedToUser', status) }) }, addNewNotifications (store, { notifications }) { @@ -382,16 +381,8 @@ const users = { store.dispatch('loginUser', data.access_token) } catch (e) { let errors = e.message - // replace ap_id with username - if (typeof errors === 'object') { - if (errors.ap_id) { - errors.username = errors.ap_id - delete errors.ap_id - } - errors = humanizeErrors(errors) - } store.commit('signUpFailure', errors) - throw Error(errors) + throw e } }, async getCaptcha (store) { @@ -419,7 +410,7 @@ const users = { }) .then(() => { store.commit('clearCurrentUser') - store.dispatch('disconnectFromChat') + store.dispatch('disconnectFromSocket') store.commit('clearToken') store.dispatch('stopFetching', 'friends') store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken())) |
