diff --git a/src/client/app/common/define-widget.ts b/src/client/app/common/define-widget.ts index 0b2bc3656..2fae28be7 100644 --- a/src/client/app/common/define-widget.ts +++ b/src/client/app/common/define-widget.ts @@ -9,9 +9,9 @@ export default function(data: { widget: { type: Object }, - isMobile: { - type: Boolean, - default: false + platform: { + type: String, + required: true }, isCustomizeMode: { type: Boolean, @@ -66,17 +66,10 @@ export default function(data: { this.bakeProps(); - if (this.isMobile) { - (this as any).api('i/update_mobile_home', { - id: this.id, - data: this.props - }); - } else { - (this as any).api('i/update_home', { - id: this.id, - data: this.props - }); - } + (this as any).api('i/update_widget', { + id: this.id, + data: this.props + }); } } }); diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts index a27c55a60..dd18c70d7 100644 --- a/src/client/app/common/scripts/streaming/home.ts +++ b/src/client/app/common/scripts/streaming/home.ts @@ -58,25 +58,18 @@ export class HomeStream extends Stream { }); this.on('home_updated', x => { - if (x.home) { - os.store.commit('settings/setHome', x.home); - } else { - os.store.commit('settings/setHomeWidget', { - id: x.id, - data: x.data - }); - } + os.store.commit('settings/setHome', x); }); this.on('mobile_home_updated', x => { - if (x.home) { - os.store.commit('settings/setMobileHome', x.home); - } else { - os.store.commit('settings/setMobileHomeWidget', { - id: x.id, - data: x.data - }); - } + os.store.commit('settings/setMobileHome', x); + }); + + this.on('widgetUpdated', x => { + os.store.commit('settings/setWidget', { + id: x.id, + data: x.data + }); }); // トークンが再生成されたとき diff --git a/src/client/app/common/views/components/menu.vue b/src/client/app/common/views/components/menu.vue index e5df8345b..73c8403ad 100644 --- a/src/client/app/common/views/components/menu.vue +++ b/src/client/app/common/views/components/menu.vue @@ -2,7 +2,10 @@
- +
@@ -150,4 +153,9 @@ $border-color = rgba(27, 31, 35, 0.15) color $theme-color-foreground background darken($theme-color, 10%) + > div + margin 8px 0 + height 1px + background #eee + diff --git a/src/client/app/common/views/widgets/broadcast.vue b/src/client/app/common/views/widgets/broadcast.vue index f337cec85..69b2a54fe 100644 --- a/src/client/app/common/views/widgets/broadcast.vue +++ b/src/client/app/common/views/widgets/broadcast.vue @@ -2,7 +2,7 @@
diff --git a/src/client/app/common/views/widgets/calendar.vue b/src/client/app/common/views/widgets/calendar.vue index 0e9714960..333b56f62 100644 --- a/src/client/app/common/views/widgets/calendar.vue +++ b/src/client/app/common/views/widgets/calendar.vue @@ -1,5 +1,5 @@
+
@@ -67,7 +67,7 @@ export default define({ }, methods: { func() { - if (this.isMobile) return; + if (this.platform == 'mobile') return; if (this.props.design == 2) { this.props.design = 0; } else { diff --git a/src/client/app/common/views/widgets/donation.vue b/src/client/app/common/views/widgets/donation.vue index 75f5db808..470576d5e 100644 --- a/src/client/app/common/views/widgets/donation.vue +++ b/src/client/app/common/views/widgets/donation.vue @@ -1,5 +1,5 @@