fix: code linting

This commit is contained in:
Nick
2019-09-08 12:39:05 -04:00
parent 7634bd266d
commit 69e644e18f
13 changed files with 1114 additions and 2386 deletions

View File

@@ -18,11 +18,11 @@ export default {
state,
mutations: {
...make.mutations(state),
pushMediaFolderTree: (state, folder) => {
state.media.folderTree = state.media.folderTree.concat(folder)
pushMediaFolderTree: (st, folder) => {
st.media.folderTree = st.media.folderTree.concat(folder)
},
popMediaFolderTree: (state) => {
state.media.folderTree = state.media.folderTree.slice(0, -1)
popMediaFolderTree: (st) => {
st.media.folderTree = st.media.folderTree.slice(0, -1)
}
}
}

View File

@@ -33,24 +33,24 @@ export default new Vuex.Store({
},
mutations: {
...make.mutations(state),
loadingStart (state, stackName) {
state.loadingStack = _.union(state.loadingStack, [stackName])
loadingStart (st, stackName) {
st.loadingStack = _.union(st.loadingStack, [stackName])
},
loadingStop (state, stackName) {
state.loadingStack = _.without(state.loadingStack, stackName)
loadingStop (st, stackName) {
st.loadingStack = _.without(st.loadingStack, stackName)
},
showNotification (state, opts) {
state.notification = _.defaults(opts, {
showNotification (st, opts) {
st.notification = _.defaults(opts, {
message: '',
style: 'primary',
icon: 'cached',
isActive: true
})
},
updateNotificationState (state, newState) {
state.notification.isActive = newState
updateNotificationState (st, newState) {
st.notification.isActive = newState
},
pushGraphError (state, err) {
pushGraphError (st, err) {
WIKI.$store.commit('showNotification', {
style: 'red',
message: _.get(err, 'graphQLErrors[0].message', err.message),

View File

@@ -20,21 +20,21 @@ export default {
state,
mutations: {
...make.mutations(state),
REFRESH_AUTH(state) {
REFRESH_AUTH(st) {
const jwtCookie = Cookies.get('jwt')
if (jwtCookie) {
try {
const jwtData = jwt.decode(jwtCookie)
state.id = jwtData.id
state.email = jwtData.email
state.name = jwtData.name
state.pictureUrl = jwtData.pictureUrl
state.localeCode = jwtData.localeCode
state.defaultEditor = jwtData.defaultEditor
state.permissions = jwtData.permissions
state.iat = jwtData.iat
state.exp = jwtData.exp
state.authenticated = true
st.id = jwtData.id
st.email = jwtData.email
st.name = jwtData.name
st.pictureUrl = jwtData.pictureUrl
st.localeCode = jwtData.localeCode
st.defaultEditor = jwtData.defaultEditor
st.permissions = jwtData.permissions
st.iat = jwtData.iat
st.exp = jwtData.exp
st.authenticated = true
} catch (err) {
console.debug('Invalid JWT. Silent authentication skipped.')
}