From 8ca58de2ba1e6867e1ca83062269ed8fbd350c25 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 6 Jun 2018 03:12:06 +0900 Subject: [PATCH] wip --- .../app/desktop/views/pages/deck/deck.vue | 44 +++++++++++++++++-- src/client/app/store.ts | 15 +------ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index fb5e55086..079260972 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -1,10 +1,12 @@ @@ -13,11 +15,45 @@ import Vue from 'vue'; import XTlColumn from './deck.tl-column.vue'; import XNotificationsColumn from './deck.notifications-column.vue'; +import * as uuid from 'uuid'; export default Vue.extend({ components: { XTlColumn, XNotificationsColumn + }, + computed: { + columns() { + if (this.$store.state.settings.deck == null) return []; + return this.$store.state.settings.deck.columns; + } + }, + created() { + if (this.$store.state.settings.deck == null) { + const deck = { + columns: [/*{ + type: 'widgets', + widgets: [] + }, */{ + id: uuid(), + type: 'home' + }, { + id: uuid(), + type: 'notifications' + }, { + id: uuid(), + type: 'local' + }, { + id: uuid(), + type: 'global' + }] + }; + + this.$store.dispatch('settings/set', { + key: 'deck', + value: deck + }); + } } }); diff --git a/src/client/app/store.ts b/src/client/app/store.ts index 135fbe51f..7795c9477 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -7,20 +7,7 @@ import { hostname } from './config'; const defaultSettings = { home: null, mobileHome: [], - deck: { - columns: [/*{ - type: 'widgets', - widgets: [] - }, */{ - type: 'home' - }, { - type: 'notifications' - }, { - type: 'local' - }, { - type: 'global' - }] - }, + deck: null, fetchOnScroll: true, showMaps: true, showPostFormOnTopOfTl: false,