- fix: starting the app it doesn't loaded the SingleTodo correctly...
the problem was:
import { SingleTodo } from '@components' // doesn't work:
Resolve :
import { SingleTodo } from '../../SingleTodo' // correct!
This commit is contained in:
@@ -9,6 +9,7 @@ const state: IGlobalState = {
|
||||
mobileMode: false,
|
||||
menuCollapse: true,
|
||||
leftDrawerOpen: true,
|
||||
category: 'personal',
|
||||
posts: [],
|
||||
listatodo: [
|
||||
{namecat: 'personal', description: 'personal'},
|
||||
@@ -24,6 +25,7 @@ namespace Getters {
|
||||
|
||||
const conta = b.read(state => state.conta, 'conta')
|
||||
const listatodo = b.read(state => state.listatodo, 'listatodo')
|
||||
const category = b.read(state => state.category, 'category')
|
||||
|
||||
export const getters = {
|
||||
get conta() {
|
||||
@@ -32,6 +34,10 @@ namespace Getters {
|
||||
|
||||
get listaTodo() {
|
||||
return listatodo()
|
||||
},
|
||||
|
||||
get category() {
|
||||
return category()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,9 +52,15 @@ namespace Mutations {
|
||||
state.leftDrawerOpen = bool
|
||||
}
|
||||
|
||||
function setCategorySel(state: IGlobalState, cat: string) {
|
||||
state.category = cat
|
||||
}
|
||||
|
||||
|
||||
export const mutations = {
|
||||
setConta: b.commit(setConta),
|
||||
setleftDrawerOpen: b.commit(setleftDrawerOpen)
|
||||
setleftDrawerOpen: b.commit(setleftDrawerOpen),
|
||||
setCategorySel: b.commit(setCategorySel)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ const state: IUserState = {
|
||||
repeatPassword: '',
|
||||
idToken: '',
|
||||
tokens: [],
|
||||
verifiedEmail: false
|
||||
verifiedEmail: false,
|
||||
categorySel: 'personal'
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +70,7 @@ namespace Mutations {
|
||||
state.username = data.username
|
||||
state.idToken = data.idToken
|
||||
state.verifiedEmail = data.verifiedEmail
|
||||
state.category = data.categorySel
|
||||
// @ts-ignore
|
||||
state.tokens = [
|
||||
{ access: 'auth', token: data.idToken }
|
||||
@@ -106,6 +108,7 @@ namespace Mutations {
|
||||
state.tokens = []
|
||||
state.idToken = ''
|
||||
state.verifiedEmail = false
|
||||
state.categorySel = 'personal'
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
@@ -484,12 +487,14 @@ namespace Actions {
|
||||
localStorage.removeItem(rescodes.localStorage.isLogged)
|
||||
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
|
||||
localStorage.removeItem(rescodes.localStorage.verifiedEmail)
|
||||
localStorage.removeItem(rescodes.localStorage.categorySel)
|
||||
|
||||
router.push('/signin')
|
||||
}
|
||||
|
||||
function setGlobal() {
|
||||
GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(rescodes.localStorage.leftDrawerOpen) === 'true')
|
||||
GlobalStore.mutations.setCategorySel(localStorage.getItem(rescodes.localStorage.categorySel))
|
||||
}
|
||||
|
||||
async function autologin (context) {
|
||||
|
||||
@@ -10,6 +10,7 @@ export const rescodes = {
|
||||
|
||||
localStorage: {
|
||||
verifiedEmail: 'vf',
|
||||
categorySel: 'cs',
|
||||
isLogged: 'ilog',
|
||||
expirationDate: 'expdate',
|
||||
leftDrawerOpen: 'ldo',
|
||||
|
||||
Reference in New Issue
Block a user