* Fix #4292

* use commit
This commit is contained in:
MeiMei 2019-02-17 21:28:20 +09:00 committed by syuilo
parent fb4a921cd9
commit c4efbdf4c7
4 changed files with 11 additions and 6 deletions

View File

@ -124,11 +124,16 @@ init(async (launch, os) => {
require('./views/components'); require('./views/components');
require('./views/widgets'); require('./views/widgets');
os.store.commit('device/set', {
key: 'inDeckMode',
value: os.store.getters.isSignedIn && os.store.state.device.deckMode && document.location.pathname === '/'
});
// Init router // Init router
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
routes: [ routes: [
os.store.getters.isSignedIn && os.store.state.device.deckMode && document.location.pathname === '/' os.store.state.device.inDeckMode
? { path: '/', name: 'index', component: MkDeck, children: [ ? { path: '/', name: 'index', component: MkDeck, children: [
{ path: '/@:user', name: 'user', component: () => import('./views/deck/deck.user-column.vue').then(m => m.default), children: [ { path: '/@:user', name: 'user', component: () => import('./views/deck/deck.user-column.vue').then(m => m.default), children: [
{ path: '', name: 'user', component: () => import('./views/deck/deck.user-column.home.vue').then(m => m.default) }, { path: '', name: 'user', component: () => import('./views/deck/deck.user-column.home.vue').then(m => m.default) },

View File

@ -63,7 +63,7 @@
<li @click="toggleDeckMode"> <li @click="toggleDeckMode">
<p> <p>
<span>{{ $t('@.deck') }}</span> <span>{{ $t('@.deck') }}</span>
<template v-if="$store.state.device.deckMode"><i><fa :icon="faHome"/></i></template> <template v-if="$store.state.device.inDeckMode"><i><fa :icon="faHome"/></i></template>
<template v-else><i><fa :icon="faColumns"/></i></template> <template v-else><i><fa :icon="faColumns"/></i></template>
</p> </p>
</li> </li>
@ -165,7 +165,7 @@ export default Vue.extend({
}); });
}, },
toggleDeckMode() { toggleDeckMode() {
this.$store.commit('device/set', { key: 'deckMode', value: !this.$store.state.device.deckMode }); this.$store.commit('device/set', { key: 'deckMode', value: !this.$store.state.device.inDeckMode });
location.reload(); location.reload();
}, },
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="nav"> <div class="nav">
<ul> <ul>
<li v-if="!$store.state.device.deckMode" class="timeline" :class="{ active: $route.name == 'index' }" @click="goToTop"> <li v-if="!$store.state.device.inDeckMode" class="timeline" :class="{ active: $route.name == 'index' }" @click="goToTop">
<router-link to="/"><fa icon="home"/><p>{{ $t('@.timeline') }}</p></router-link> <router-link to="/"><fa icon="home"/><p>{{ $t('@.timeline') }}</p></router-link>
</li> </li>
<li class="featured" :class="{ active: $route.name == 'featured' }"> <li class="featured" :class="{ active: $route.name == 'featured' }">

View File

@ -6,7 +6,7 @@
</div> </div>
<div class="nav" v-if="$store.getters.isSignedIn"> <div class="nav" v-if="$store.getters.isSignedIn">
<template v-if="!$store.state.device.deckMode"> <template v-if="!$store.state.device.inDeckMode">
<div class="home" :class="{ active: $route.name == 'index' }" @click="goToTop"> <div class="home" :class="{ active: $route.name == 'index' }" @click="goToTop">
<router-link to="/"><fa icon="home"/></router-link> <router-link to="/"><fa icon="home"/></router-link>
</div> </div>
@ -50,7 +50,7 @@
</router-link> </router-link>
</div> </div>
<div> <div>
<template v-if="$store.state.device.deckMode"> <template v-if="$store.state.device.inDeckMode">
<a @click="toggleDeckMode(false)"><fa icon="home"/></a> <a @click="toggleDeckMode(false)"><fa icon="home"/></a>
</template> </template>
<template v-else> <template v-else>