API for blocking and unblocking

This commit is contained in:
Eugen Rochko
2016-10-03 18:17:06 +02:00
parent 2c9e672ee2
commit 7b9a4af311
10 changed files with 106 additions and 8 deletions

View File

@ -26,7 +26,7 @@ const StatusContent = React.createClass({
} else {
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener');
link.addEventListener('click', this.onNormalClick);
link.addEventListener('click', this.onNormalClick.bind(this));
}
}
},
@ -36,7 +36,7 @@ const StatusContent = React.createClass({
e.preventDefault();
this.context.router.push(`/accounts/${mention.get('id')}`);
}
e.stopPropagation();
},

View File

@ -40,11 +40,15 @@ const Mastodon = React.createClass({
if (typeof App !== 'undefined') {
App.timeline = App.cable.subscriptions.create("TimelineChannel", {
connected: function() {},
connected () {
disconnected: function() {},
},
received: function(data) {
disconnected () {
},
received (data) {
switch(data.type) {
case 'update':
return store.dispatch(updateTimeline(data.timeline, JSON.parse(data.message)));
@ -53,6 +57,8 @@ const Mastodon = React.createClass({
case 'merge':
case 'unmerge':
return store.dispatch(refreshTimeline('home'));
case 'block':
return store.dispatch(refreshTimeline('mentions'));
}
}
});