From 2de118a45d0c9da11f652f9603650bd4008d8d4d Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 21 Feb 2017 20:34:54 +0900 Subject: wip --- src/web/app/common/tags/signin-history.tag | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/web/app/common') diff --git a/src/web/app/common/tags/signin-history.tag b/src/web/app/common/tags/signin-history.tag index 47bf68c283..3868980058 100644 --- a/src/web/app/common/tags/signin-history.tag +++ b/src/web/app/common/tags/signin-history.tag @@ -55,21 +55,23 @@ this.fetching = true; this.on('mount', () => { - this.api 'i/signin_history' - }).then((history) => { - this.history = history - this.fetching = false - this.update(); - .catch (err) => - console.error err + this.api('i/signin_history').then(history => { + this.update({ + fetching: false, + history: history + }); + }); - this.stream.on 'signin' this.on-signin + this.stream.on('signin', this.onSignin); + }); this.on('unmount', () => { - this.stream.off 'signin' this.on-signin + this.stream.off('signin', this.onSignin); + }); - this.on-signin = (signin) => { - @history.unshift signin + this.onSignin = signin => { + this.history.unshift(signin); this.update(); + }; -- cgit v1.2.3-freya