Commit de52e4e9 authored by Adrian's avatar Adrian

arreglando condicionales

parent 1eb8d73b
......@@ -147,7 +147,7 @@
v-bind="getAttrs"
:class="getViewLayout"
:right="viewLayout.right"
:mini-variant.sync="$store.state.drawer"
:mini-variant.sync="$store.state.mini"
>
<template v-slot:prepend>
<v-list-item
......@@ -294,8 +294,8 @@
<template v-slot:append>
<div class="pa-2">
<v-btn outlined :icon="drawer" :block="!drawer" color="info lighten-1" @click="exit">
<template v-if="!drawer">
<v-btn outlined :icon="mini" :block="!mini" color="info lighten-1" @click="exit">
<template v-if="!mini">
Cerrar sessión
</template>
<template v-else>
......@@ -359,7 +359,7 @@ export default {
}
},
computed: {
...mapState(['menu', 'initialViewLayout', 'drawer', 'sidenav']),
...mapState(['menu', 'initialViewLayout', 'drawer', 'mini', 'sidenav']),
miniVariant() {
if (this.breakpoints.includes(this.$vuetify.breakpoint.name)) {
return !this.drawer;
......@@ -385,9 +385,9 @@ export default {
getIcon() {
let icon;
if (this.initialViewLayout === 'left') {
icon = this.drawer ? 'arrow_forward' : 'arrow_back';
icon = this.mini ? 'arrow_forward' : 'arrow_back';
} else if (this.initialViewLayout === 'right') {
icon = this.drawer ? 'arrow_back' : 'arrow_forward';
icon = this.mini ? 'arrow_back' : 'arrow_forward';
}
return icon;
},
......
......@@ -201,8 +201,7 @@ export default {
if (error.response.status === 401) {
if (window.location.hash !== '#/login') {
Message.error('Termino la session');
store.commit('setAuth', false);
instance.logout(store, router);
router.push('/login');
}
}
if (error.response.status === 402) {
......
......@@ -50,6 +50,7 @@ export default new Vuex.Store({
theme: ''
},
drawer: true,
mini: false,
initialViewLayout: 'left'
},
mutations: {
......@@ -58,6 +59,7 @@ export default new Vuex.Store({
},
setDrawer(state, value) {
state.drawer = value;
state.mini = !value;
},
setMain(state, value) {
state.main = value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment