diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-06-06 02:48:26 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-06-06 02:48:26 +0900 |
| commit | f9180811680aa66706d722384cba4d82d7a2e52c (patch) | |
| tree | af425f54d137741b83985dfb74b12c9ca4df04ec /src/client | |
| parent | wip (diff) | |
| download | misskey-f9180811680aa66706d722384cba4d82d7a2e52c.tar.gz misskey-f9180811680aa66706d722384cba4d82d7a2e52c.tar.bz2 misskey-f9180811680aa66706d722384cba4d82d7a2e52c.zip | |
wip
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/desktop/views/components/home.vue | 52 | ||||
| -rw-r--r-- | src/client/app/store.ts | 15 |
2 files changed, 67 insertions, 0 deletions
diff --git a/src/client/app/desktop/views/components/home.vue b/src/client/app/desktop/views/components/home.vue index 636ed871c7..d3ba84a4b3 100644 --- a/src/client/app/desktop/views/components/home.vue +++ b/src/client/app/desktop/views/components/home.vue @@ -76,6 +76,50 @@ import Vue from 'vue'; import * as XDraggable from 'vuedraggable'; import * as uuid from 'uuid'; +const defaultDesktopHomeWidgets = { + left: [ + 'profile', + 'calendar', + 'activity', + 'rss', + 'trends', + 'photo-stream', + 'version' + ], + right: [ + 'broadcast', + 'notifications', + 'users', + 'polls', + 'server', + 'donation', + 'nav', + 'tips' + ] +}; + +//#region Construct home data +const _defaultDesktopHomeWidgets = []; + +defaultDesktopHomeWidgets.left.forEach(widget => { + _defaultDesktopHomeWidgets.push({ + name: widget, + id: uuid(), + place: 'left', + data: {} + }); +}); + +defaultDesktopHomeWidgets.right.forEach(widget => { + _defaultDesktopHomeWidgets.push({ + name: widget, + id: uuid(), + place: 'right', + data: {} + }); +}); +//#endregion + export default Vue.extend({ components: { XDraggable @@ -119,6 +163,14 @@ export default Vue.extend({ } }, + created() { + if (this.$store.state.i.clientSettings == null || this.$store.state.i.clientSettings.home == null) { + this.api('i/update_home', { + home: _defaultDesktopHomeWidgets + }); + } + }, + mounted() { this.connection = (this as any).os.stream.getConnection(); this.connectionId = (this as any).os.stream.use(); diff --git a/src/client/app/store.ts b/src/client/app/store.ts index 905ec0501c..00cae3b857 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -7,6 +7,20 @@ import { hostname } from './config'; const defaultSettings = { home: [], mobileHome: [], + deck: { + columns: [/*{ + type: 'widgets', + widgets: [] + }, */{ + type: 'home' + }, { + type: 'notifications' + }, { + type: 'local' + }, { + type: 'global' + }] + }, fetchOnScroll: true, showMaps: true, showPostFormOnTopOfTl: false, @@ -156,6 +170,7 @@ export default (os: MiOS) => new Vuex.Store({ actions: { merge(ctx, settings) { + if (settings == null) return; Object.entries(settings).forEach(([key, value]) => { ctx.commit('set', { key, value }); }); |