diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-06-21 01:50:01 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-06-21 01:50:01 +0900 |
| commit | 18184441f1eabb34696ea4771051eb3aa8334ce4 (patch) | |
| tree | 49427519926db1b7dd7b0973ce101da117e34e5d /src/client/app/desktop | |
| parent | Provide Redis version (diff) | |
| download | misskey-18184441f1eabb34696ea4771051eb3aa8334ce4.tar.gz misskey-18184441f1eabb34696ea4771051eb3aa8334ce4.tar.bz2 misskey-18184441f1eabb34696ea4771051eb3aa8334ce4.zip | |
ホームのカスタマイズ情報を複数のデバイス間で同期できるように
Diffstat (limited to 'src/client/app/desktop')
| -rw-r--r-- | src/client/app/desktop/views/home/home.vue | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/client/app/desktop/views/home/home.vue b/src/client/app/desktop/views/home/home.vue index d4677df842..49ac4c2407 100644 --- a/src/client/app/desktop/views/home/home.vue +++ b/src/client/app/desktop/views/home/home.vue @@ -102,7 +102,11 @@ export default Vue.extend({ computed: { home(): any[] { if (this.$store.getters.isSignedIn) { - return this.$store.state.device.home || []; + if (this.$store.state.device.homeProfile) { + return this.$store.state.settings.homeProfiles[this.$store.state.device.homeProfile] || this.$store.state.device.home || []; + } else { + return this.$store.state.device.home || []; + } } else { return [{ name: 'instance', @@ -186,6 +190,14 @@ export default Vue.extend({ if (this.$store.state.device.home == null) { this.$store.commit('device/setHome', _defaultDesktopHomeWidgets); } + + if (this.$store.state.device.homeProfile) { + this.$watch('$store.state.device.home', () => { + this.$store.dispatch('settings/updateHomeProfile'); + }, { + deep: true + }); + } } }, @@ -245,7 +257,7 @@ export default Vue.extend({ focus() { (this.$refs.content as any).focus(); - } + }, } }); </script> |