diff --git a/src/store.js b/src/store.js index 5b874d2..4de443f 100644 --- a/src/store.js +++ b/src/store.js @@ -2,9 +2,11 @@ import { reactive, readonly } from 'vue' import axios from 'axios' import { handleMsg, sendSub } from './utils/websocket' +const token = localStorage.getItem('token') + const state = reactive({ name: '', - token: '', + token: token || '', session: '', loggedIn: false, ws: null, @@ -21,7 +23,7 @@ const state = reactive({ const methods = { authenticate: async (token) => { - console.log(token) + localStorage.setItem('token', token) return axios.post('http://178.79.128.135:5000/api/v1', { token, }) diff --git a/src/views/Home.vue b/src/views/Home.vue index 75df8e2..7255f6e 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -92,8 +92,6 @@ export default { window.ipcRenderer.on('test', (e, msg) => { const data = JSON.parse(msg) - // const games = m.hasOwnProperty('games') ? m.games.push(data.game) : [data.game] - update('matches', data.id, { started: data.started, done: data.done, diff --git a/src/views/Login.vue b/src/views/Login.vue index 74b24a9..1f65d22 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -1,6 +1,6 @@