@@ -341,7 +379,7 @@ class Notification extends ImmutablePureComponent {
-
+
);
@@ -349,30 +387,26 @@ class Notification extends ImmutablePureComponent {
render() {
const { notification } = this.props;
- const account = notification.get('account');
- const targetAccount = notification.get('target');
- const displayNameHtml = { __html: account.get('display_name_html') };
- const link =
;
switch(notification.get('type')) {
case 'follow':
- return this.renderFollow(notification, account, link);
+ return this.renderFollow(notification);
case 'follow_request':
- return this.renderFollowRequest(notification, account, link);
+ return this.renderFollowRequest(notification);
case 'mention':
return this.renderMention(notification);
case 'favourite':
- return this.renderFavourite(notification, link);
+ return this.renderFavourite(notification);
case 'reblog':
- return this.renderReblog(notification, link);
+ return this.renderReblog(notification);
case 'poll':
return this.renderPoll(notification);
case 'move':
- return this.renderMove(notification, account, targetAccount, link);
+ return this.renderMove(notification);
case 'pleroma:emoji_reaction':
- return this.renderEmojiReact(notification, link);
+ return this.renderEmojiReact(notification);
case 'pleroma:chat_mention':
- return this.renderChatMention(notification, link);
+ return this.renderChatMention(notification);
}
return null;
diff --git a/app/soapbox/features/notifications/containers/notification_container.js b/app/soapbox/features/notifications/containers/notification_container.js
index 345d3ba13..fb407263a 100644
--- a/app/soapbox/features/notifications/containers/notification_container.js
+++ b/app/soapbox/features/notifications/containers/notification_container.js
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
-import { makeGetNotification, makeGetStatus } from '../../../selectors';
+import { makeGetNotification } from '../../../selectors';
import Notification from '../components/notification';
import { openModal } from '../../../actions/modal';
import { mentionCompose } from '../../../actions/compose';
@@ -17,13 +17,10 @@ import { getSettings } from 'soapbox/actions/settings';
const makeMapStateToProps = () => {
const getNotification = makeGetNotification();
- const getStatus = makeGetStatus();
const mapStateToProps = (state, props) => {
- const notification = getNotification(state, props.notification, props.accountId, props.targetId);
return {
- notification: notification,
- status: notification.get('status') ? getStatus(state, { id: notification.get('status') }) : null,
+ notification: getNotification(state, props.notification),
};
};
diff --git a/app/soapbox/features/notifications/index.js b/app/soapbox/features/notifications/index.js
index 79f879deb..bea5e82a4 100644
--- a/app/soapbox/features/notifications/index.js
+++ b/app/soapbox/features/notifications/index.js
@@ -152,8 +152,6 @@ class Notifications extends React.PureComponent {
diff --git a/app/soapbox/selectors/index.js b/app/soapbox/selectors/index.js
index b382957ee..9594a5750 100644
--- a/app/soapbox/selectors/index.js
+++ b/app/soapbox/selectors/index.js
@@ -182,11 +182,12 @@ export const getAlerts = createSelector([getAlertsBase], (base) => {
export const makeGetNotification = () => {
return createSelector([
- (_, base) => base,
- (state, _, accountId) => state.getIn(['accounts', accountId]),
- (state, _, __, targetId) => state.getIn(['accounts', targetId]),
- ], (base, account, target) => {
- return base.set('account', account).set('target', target);
+ (state, notification) => notification,
+ (state, notification) => state.getIn(['accounts', notification.get('account')]),
+ (state, notification) => state.getIn(['accounts', notification.get('target')]),
+ (state, notification) => state.getIn(['statuses', notification.get('status')]),
+ ], (notification, account, target, status) => {
+ return notification.merge({ account, target, status });
});
};