ホームのカスタマイズ情報を複数のデバイス間で同期できるように

This commit is contained in:
syuilo
2019-06-21 01:50:01 +09:00
parent bd83939993
commit 18184441f1
5 changed files with 75 additions and 3 deletions

View File

@@ -72,7 +72,11 @@ export default Vue.extend({
computed: {
widgets(): any[] {
return this.$store.state.device.mobileHome;
if (this.$store.state.device.mobileHomeProfile) {
return this.$store.state.settings.mobileHomeProfiles[this.$store.state.device.mobileHomeProfile] || this.$store.state.device.mobileHome;
} else {
return this.$store.state.device.mobileHome;
}
}
},
@@ -98,6 +102,14 @@ export default Vue.extend({
id: 'g', data: {}
}]);
}
if (this.$store.state.device.mobileHomeProfile) {
this.$watch('$store.state.device.mobileHome', () => {
this.$store.dispatch('settings/updateMobileHomeProfile');
}, {
deep: true
});
}
},
mounted() {