diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-20 19:39:18 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-20 19:39:58 +0100 |
commit | 38dd85daab8e8342ec608d24cf81254c0dfde95c (patch) | |
tree | 33502dcbfd0af447fb5b1ef7147485c8c9de95b0 /app/assets/javascripts/components/containers/mastodon.jsx | |
parent | da2ef4d676ff71e6ab3edf8d1a7cee8bf6b6d353 (diff) |
Adding notifications column
Diffstat (limited to 'app/assets/javascripts/components/containers/mastodon.jsx')
-rw-r--r-- | app/assets/javascripts/components/containers/mastodon.jsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index b2c978ee8..cf77c169d 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -6,6 +6,7 @@ import { deleteFromTimelines, refreshTimeline } from '../actions/timelines'; +import { updateNotifications } from '../actions/notifications'; import { setAccessToken } from '../actions/meta'; import { setAccountSelf } from '../actions/accounts'; import PureRenderMixin from 'react-addons-pure-render-mixin'; @@ -32,6 +33,7 @@ import Following from '../features/following'; import Reblogs from '../features/reblogs'; import Favourites from '../features/favourites'; import HashtagTimeline from '../features/hashtag_timeline'; +import Notifications from '../features/notifications'; import { IntlProvider, addLocaleData } from 'react-intl'; import en from 'react-intl/locale-data/en'; import de from 'react-intl/locale-data/de'; @@ -75,11 +77,18 @@ const Mastodon = React.createClass({ return store.dispatch(refreshTimeline('home', true)); case 'block': return store.dispatch(refreshTimeline('mentions', true)); + case 'notification': + return store.dispatch(updateNotifications(JSON.parse(data.message))); } } }); } + + // Desktop notifications + if (Notification.permission === 'default') { + Notification.requestPermission(); + } }, componentWillUnmount () { @@ -103,6 +112,8 @@ const Mastodon = React.createClass({ <Route path='timelines/public' component={PublicTimeline} /> <Route path='timelines/tag/:id' component={HashtagTimeline} /> + <Route path='notifications' component={Notifications} /> + <Route path='statuses/new' component={Compose} /> <Route path='statuses/:statusId' component={Status} /> <Route path='statuses/:statusId/reblogs' component={Reblogs} /> |