From c4efbdf4c7f10942a578b1b1387e625fe12e70c6 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 17 Feb 2019 21:28:20 +0900 Subject: [PATCH] Fix #4292 (#4294) * Fix #4292 * use commit --- src/client/app/desktop/script.ts | 7 ++++++- .../app/desktop/views/components/ui.header.account.vue | 4 ++-- src/client/app/desktop/views/components/ui.header.nav.vue | 2 +- src/client/app/desktop/views/components/ui.sidebar.vue | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index 9fa4ec39f6..6957f34d75 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -124,11 +124,16 @@ init(async (launch, os) => { require('./views/components'); 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 const router = new VueRouter({ mode: 'history', 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: '/@: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) }, diff --git a/src/client/app/desktop/views/components/ui.header.account.vue b/src/client/app/desktop/views/components/ui.header.account.vue index d94549c2aa..37983285c4 100644 --- a/src/client/app/desktop/views/components/ui.header.account.vue +++ b/src/client/app/desktop/views/components/ui.header.account.vue @@ -63,7 +63,7 @@ <li @click="toggleDeckMode"> <p> <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> </p> </li> @@ -165,7 +165,7 @@ export default Vue.extend({ }); }, 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(); }, } diff --git a/src/client/app/desktop/views/components/ui.header.nav.vue b/src/client/app/desktop/views/components/ui.header.nav.vue index e10ff08de5..690d2fe847 100644 --- a/src/client/app/desktop/views/components/ui.header.nav.vue +++ b/src/client/app/desktop/views/components/ui.header.nav.vue @@ -1,7 +1,7 @@ <template> <div class="nav"> <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> </li> <li class="featured" :class="{ active: $route.name == 'featured' }"> diff --git a/src/client/app/desktop/views/components/ui.sidebar.vue b/src/client/app/desktop/views/components/ui.sidebar.vue index 1380c3d48c..c404d03a12 100644 --- a/src/client/app/desktop/views/components/ui.sidebar.vue +++ b/src/client/app/desktop/views/components/ui.sidebar.vue @@ -6,7 +6,7 @@ </div> <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"> <router-link to="/"><fa icon="home"/></router-link> </div> @@ -50,7 +50,7 @@ </router-link> </div> <div> - <template v-if="$store.state.device.deckMode"> + <template v-if="$store.state.device.inDeckMode"> <a @click="toggleDeckMode(false)"><fa icon="home"/></a> </template> <template v-else>