|
@@ -14,7 +14,8 @@ const createStore = () => {
|
|
|
category: '',
|
|
|
token: null,
|
|
|
country: 'us',
|
|
|
- user: null
|
|
|
+ user: null,
|
|
|
+ source: ''
|
|
|
},
|
|
|
mutations: {
|
|
|
setHeadLines (state, headlines) {
|
|
@@ -41,6 +42,9 @@ const createStore = () => {
|
|
|
setFeed (state, headlines) {
|
|
|
state.feed = headlines
|
|
|
},
|
|
|
+ setSource (state, source) {
|
|
|
+ state.source = source
|
|
|
+ },
|
|
|
clearToken: state => (state.token = null),
|
|
|
clearUser: state => (state.user = null),
|
|
|
clearFeed: state => (state.feed = [])
|
|
@@ -225,7 +229,8 @@ const createStore = () => {
|
|
|
category: state => state.category,
|
|
|
country: state => state.country,
|
|
|
isAuthenticated: state => !!state.token,
|
|
|
- user: state => state.user
|
|
|
+ user: state => state.user,
|
|
|
+ source: state => state.source
|
|
|
}
|
|
|
})
|
|
|
}
|