diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-01 19:33:08 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-01 19:33:08 +0900 |
| commit | d6b03c43eb818a5e13a8ad1ec69697e4600c5c2c (patch) | |
| tree | 20302f7974e7939f2e498b07bd11c86bea4f7e82 /src/web | |
| parent | v2799 (diff) | |
| download | misskey-d6b03c43eb818a5e13a8ad1ec69697e4600c5c2c.tar.gz misskey-d6b03c43eb818a5e13a8ad1ec69697e4600c5c2c.tar.bz2 misskey-d6b03c43eb818a5e13a8ad1ec69697e4600c5c2c.zip | |
Implement Channel Watching
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/ch/tags/channel.tag | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag index ad254c98e5..57cedf10d4 100644 --- a/src/web/app/ch/tags/channel.tag +++ b/src/web/app/ch/tags/channel.tag @@ -4,6 +4,11 @@ <main if={ !fetching }> <h1>{ channel.title }</h1> + <div if={ SIGNIN }> + <p if={ channel.is_watching }>このチャンネルをウォッチしています <a onclick={ unwatch }>ウォッチ解除</a></p> + <p if={ !channel.is_watching }><a onclick={ watch }>このチャンネルをウォッチする</a></p> + </div> + <div class="share"> <mk-twitter-button/> <mk-line-button/> @@ -131,6 +136,28 @@ document.title = this.channel.title + ' | Misskey' } }; + + this.watch = () => { + this.api('channels/watch', { + channel_id: this.id + }).then(() => { + this.channel.is_watching = true; + this.update(); + }, e => { + alert('error'); + }); + }; + + this.unwatch = () => { + this.api('channels/unwatch', { + channel_id: this.id + }).then(() => { + this.channel.is_watching = false; + this.update(); + }, e => { + alert('error'); + }); + }; </script> </mk-channel> |