From 37e5a9d06a492832e8e04f6029be58edb45bab5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=93=E3=81=B4=E3=81=AA=E3=81=9F=E3=81=BF=E3=81=BD?= Date: Mon, 26 Feb 2018 18:31:55 +0900 Subject: [PATCH] Fix bug --- src/web/app/common/scripts/streaming/home-stream.ts | 1 + src/web/app/common/views/components/twitter-setting.vue | 8 +++++--- src/web/app/desktop/views/components/home.vue | 2 +- src/web/app/mobile/views/components/ui.header.vue | 1 + src/web/app/mobile/views/pages/home.vue | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/web/app/common/scripts/streaming/home-stream.ts b/src/web/app/common/scripts/streaming/home-stream.ts index a92b61caed..b8e417b6d4 100644 --- a/src/web/app/common/scripts/streaming/home-stream.ts +++ b/src/web/app/common/scripts/streaming/home-stream.ts @@ -13,6 +13,7 @@ export default class Connection extends Stream { // 最終利用日時を更新するため定期的にaliveメッセージを送信 setInterval(() => { this.send({ type: 'alive' }); + me.last_used_at = new Date(); }, 1000 * 60); // 自分の情報が更新されたとき diff --git a/src/web/app/common/views/components/twitter-setting.vue b/src/web/app/common/views/components/twitter-setting.vue index aaca6ccddd..a0de27085f 100644 --- a/src/web/app/common/views/components/twitter-setting.vue +++ b/src/web/app/common/views/components/twitter-setting.vue @@ -23,12 +23,14 @@ export default Vue.extend({ docsUrl }; }, - watch: { - 'os.i'() { + mounted() { + this.$watch('os.i', () => { if ((this as any).os.i.twitter) { if (this.form) this.form.close(); } - } + }, { + deep: true + }); }, methods: { connect() { diff --git a/src/web/app/desktop/views/components/home.vue b/src/web/app/desktop/views/components/home.vue index 69f06fbf37..a7c61f4c57 100644 --- a/src/web/app/desktop/views/components/home.vue +++ b/src/web/app/desktop/views/components/home.vue @@ -126,7 +126,7 @@ export default Vue.extend({ created() { this.widgets.left = this.left; this.widgets.right = this.right; - this.$watch('os.i', i => { + this.$watch('os.i.client_settings', i => { this.widgets.left = this.left; this.widgets.right = this.right; }, { diff --git a/src/web/app/mobile/views/components/ui.header.vue b/src/web/app/mobile/views/components/ui.header.vue index 4962c5b0b4..f4b98d36f2 100644 --- a/src/web/app/mobile/views/components/ui.header.vue +++ b/src/web/app/mobile/views/components/ui.header.vue @@ -56,6 +56,7 @@ export default Vue.extend({ const ago = (new Date().getTime() - new Date((this as any).os.i.last_used_at).getTime()) / 1000 const isHisasiburi = ago >= 3600; + (this as any).os.i.last_used_at = new Date(); if (isHisasiburi) { (this.$refs.welcomeback as any).style.display = 'block'; (this.$refs.main as any).style.overflow = 'hidden'; diff --git a/src/web/app/mobile/views/pages/home.vue b/src/web/app/mobile/views/pages/home.vue index 2aa650ec53..44b0724915 100644 --- a/src/web/app/mobile/views/pages/home.vue +++ b/src/web/app/mobile/views/pages/home.vue @@ -111,7 +111,7 @@ export default Vue.extend({ this.widgets = (this as any).os.i.client_settings.mobile_home; } - this.$watch('os.i', i => { + this.$watch('os.i.client_settings', i => { this.widgets = (this as any).os.i.client_settings.mobile_home; }, { deep: true