aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/auth_flow.js8
-rw-r--r--src/modules/instance.js1
-rw-r--r--src/modules/statuses.js7
-rw-r--r--src/modules/users.js9
4 files changed, 16 insertions, 9 deletions
diff --git a/src/modules/auth_flow.js b/src/modules/auth_flow.js
index d0a90feb..956d40e8 100644
--- a/src/modules/auth_flow.js
+++ b/src/modules/auth_flow.js
@@ -7,7 +7,6 @@ const RECOVERY_STRATEGY = 'recovery'
// initial state
const state = {
- app: null,
settings: {},
strategy: PASSWORD_STRATEGY,
initStrategy: PASSWORD_STRATEGY // default strategy from config
@@ -16,14 +15,10 @@ const state = {
const resetState = (state) => {
state.strategy = state.initStrategy
state.settings = {}
- state.app = null
}
// getters
const getters = {
- app: (state, getters) => {
- return state.app
- },
settings: (state, getters) => {
return state.settings
},
@@ -55,9 +50,8 @@ const mutations = {
requireToken (state) {
state.strategy = TOKEN_STRATEGY
},
- requireMFA (state, { app, settings }) {
+ requireMFA (state, { settings }) {
state.settings = settings
- state.app = app
state.strategy = TOTP_STRATEGY // default strategy of MFA
},
requireRecovery (state) {
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 96f14ed5..625323b9 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -27,6 +27,7 @@ const defaultState = {
scopeCopy: true,
subjectLineBehavior: 'email',
postContentType: 'text/plain',
+ hideSitename: false,
nsfwCensorImage: undefined,
vapidPublicKey: undefined,
noAttachmentLinks: false,
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 6a743a4a..7d88761c 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -38,6 +38,7 @@ export const defaultState = () => ({
notifications: emptyNotifications(),
favorites: new Set(),
error: false,
+ errorData: null,
timelines: {
mentions: emptyTl(),
public: emptyTl(),
@@ -479,6 +480,9 @@ export const mutations = {
setError (state, { value }) {
state.error = value
},
+ setErrorData (state, { value }) {
+ state.errorData = value
+ },
setNotificationsLoading (state, { value }) {
state.notifications.loading = value
},
@@ -528,6 +532,9 @@ const statuses = {
setError ({ rootState, commit }, { value }) {
commit('setError', { value })
},
+ setErrorData ({ rootState, commit }, { value }) {
+ commit('setErrorData', { value })
+ },
setNotificationsLoading ({ rootState, commit }, { value }) {
commit('setNotificationsLoading', { value })
},
diff --git a/src/modules/users.js b/src/modules/users.js
index 5dc2f36f..e54588df 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -95,9 +95,9 @@ export const mutations = {
newRights[right] = value
set(user, 'rights', newRights)
},
- updateActivationStatus (state, { user: { id }, status }) {
+ updateActivationStatus (state, { user: { id }, deactivated }) {
const user = state.usersObject[id]
- set(user, 'deactivated', !status)
+ set(user, 'deactivated', deactivated)
},
setCurrentUser (state, user) {
state.lastLoginName = user.screen_name
@@ -331,6 +331,11 @@ const users = {
return rootState.api.backendInteractor.unsubscribeUser({ id })
.then((relationship) => commit('updateUserRelationship', [relationship]))
},
+ toggleActivationStatus ({ rootState, commit }, user) {
+ const api = user.deactivated ? rootState.api.backendInteractor.activateUser : rootState.api.backendInteractor.deactivateUser
+ api(user)
+ .then(({ deactivated }) => commit('updateActivationStatus', { user, deactivated }))
+ },
registerPushNotifications (store) {
const token = store.state.currentUser.credentials
const vapidPublicKey = store.rootState.instance.vapidPublicKey