I need to get back into using git. The hell is wrong with me!?
This commit is contained in:
@@ -6,17 +6,12 @@ Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
count: 0,
|
||||
message: 'Get out me yard ya wankers',
|
||||
token: null,
|
||||
username: null,
|
||||
nightMode: false,
|
||||
isUserOnMobile: false,
|
||||
},
|
||||
mutations: {
|
||||
increment (state) {
|
||||
state.count++
|
||||
},
|
||||
setLoginToken(state, userData){
|
||||
|
||||
const username = userData.username
|
||||
@@ -29,7 +24,7 @@ export default new Vuex.Store({
|
||||
localStorage.setItem('username', username)
|
||||
|
||||
//Set default token to axios, every request will have header
|
||||
axios.defaults.headers.common['Authorization'] = token
|
||||
axios.defaults.headers.common['authorizationtoken'] = token
|
||||
|
||||
state.token = token
|
||||
state.username = username
|
||||
@@ -39,7 +34,7 @@ export default new Vuex.Store({
|
||||
//Remove login token from local storage and from headers
|
||||
localStorage.removeItem('loginToken')
|
||||
localStorage.removeItem('username')
|
||||
delete axios.defaults.headers.common['Authorization']
|
||||
delete axios.defaults.headers.common['authorizationtoken']
|
||||
state.token = null
|
||||
state.username = null
|
||||
},
|
||||
@@ -54,6 +49,7 @@ export default new Vuex.Store({
|
||||
'background_color': '#fff',
|
||||
'text_color': '#3d3d3d',
|
||||
'outline_color': 'rgba(34,36,38,.15)',
|
||||
'border_color': 'rgba(34,36,38,.20)',
|
||||
}
|
||||
//Night mode colors
|
||||
if(state.nightMode){
|
||||
@@ -61,6 +57,7 @@ export default new Vuex.Store({
|
||||
'background_color': '#000',
|
||||
'text_color': '#a98457',
|
||||
'outline_color': '#a98457',
|
||||
'border_color': '#a98457',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +81,6 @@ export default new Vuex.Store({
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getRudeMessage: state => {
|
||||
return state.message
|
||||
},
|
||||
getUsername: state => {
|
||||
return state.username
|
||||
},
|
||||
|
Reference in New Issue
Block a user