aboutsummaryrefslogtreecommitdiff
path: root/src/modules/users.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-04-07 20:33:11 +0300
committerHenry Jameson <me@hjkos.com>2019-04-07 20:33:11 +0300
commit9108737d55300d8a4f822ba94335d8b53f04854d (patch)
tree76c51864a8f84edf260f2cf2fcf7625799f2533f /src/modules/users.js
parent8c7f765dff8b66ff27aeeab5bc09cd715ab328a9 (diff)
Webpack 4, ESLint with Vue, Node-sass, updated dependencies overall. New linting.
Diffstat (limited to 'src/modules/users.js')
-rw-r--r--src/modules/users.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/users.js b/src/modules/users.js
index 1a507d31..e1eba5e6 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -224,8 +224,8 @@ const users = {
.then((friends) => {
commit('addFriends', { id: user.id, friends })
resolve(friends)
- }).catch(() => {
- reject()
+ }).catch(e => {
+ reject(e)
})
})
},
@@ -279,8 +279,8 @@ const users = {
const notificationsObject = store.rootState.statuses.notifications.idStore
const relevantNotifications = Object.entries(notificationsObject)
- .filter(([k, val]) => notificationIds.includes(k))
- .map(([k, val]) => val)
+ .filter(([k, val]) => notificationIds.includes(k))
+ .map(([k, val]) => val)
// Reconnect users to notifications
each(relevantNotifications, (notification) => {
@@ -322,7 +322,7 @@ const users = {
}
},
async getCaptcha (store) {
- return await store.rootState.api.backendInteractor.getCaptcha()
+ return store.rootState.api.backendInteractor.getCaptcha()
},
logout (store) {
@@ -376,19 +376,19 @@ const users = {
// Authentication failed
commit('endLogin')
if (response.status === 401) {
- reject('Wrong username or password')
+ reject(new Error('Wrong username or password'))
} else {
- reject('An error occurred, please try again')
+ reject(new Error('An error occurred, please try again'))
}
}
commit('endLogin')
resolve()
})
- .catch((error) => {
- console.log(error)
- commit('endLogin')
- reject('Failed to connect to server, try again')
- })
+ .catch((error) => {
+ console.log(error)
+ commit('endLogin')
+ reject(new Error('Failed to connect to server, try again'))
+ })
})
}
}