diff options
author | Ondřej Hruška <ondra@ondrovo.com> | 2017-10-06 09:34:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 09:34:12 +0200 |
commit | 1a8011648fa436fdf9dd6ed1af8f5ffe0d324430 (patch) | |
tree | 436700a66f06e9d89fa7a794b04e14ec35131f1a /app | |
parent | b1217242fc3949b9a9fbee3e654fd16a0abd8a03 (diff) | |
parent | 37e141bccbb72a483b81eab359c19e336fed1029 (diff) |
Merge pull request #160 from glitch-soc/ugly-fix-notif-clearing
workaround for notif clearing
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/glitch/components/notification/container.js | 34 | ||||
-rw-r--r-- | app/javascript/mastodon/features/status/components/detailed_status.js | 8 |
2 files changed, 17 insertions, 25 deletions
diff --git a/app/javascript/glitch/components/notification/container.js b/app/javascript/glitch/components/notification/container.js index e29d6ba60..dc4c2168a 100644 --- a/app/javascript/glitch/components/notification/container.js +++ b/app/javascript/glitch/components/notification/container.js @@ -19,38 +19,30 @@ Imports: // Package imports // import { connect } from 'react-redux'; -// Mastodon imports // -import { makeGetNotification } from '../../../mastodon/selectors'; - // Our imports // import Notification from '.'; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -/* - -State mapping: --------------- +const mapStateToProps = (state, props) => { + // replace account id with object + let leNotif = props.notification.set('account', state.getIn(['accounts', props.notification.get('account')])); -The `mapStateToProps()` function maps various state properties to the -props of our component. We wrap this in `makeMapStateToProps()` so that -we only have to call `makeGetNotification()` once instead of every -time. + // populate markedForDelete from state - is mysteriously lost somewhere + for (let n of state.getIn(['notifications', 'items'])) { + if (n.get('id') === props.notification.get('id')) { + leNotif = leNotif.set('markedForDelete', n.get('markedForDelete')); + break; + } + } -*/ - -const makeMapStateToProps = () => { - const getNotification = makeGetNotification(); - - const mapStateToProps = (state, props) => ({ - notification: getNotification(state, props.notification, props.accountId), + return ({ + notification: leNotif, settings: state.get('local_settings'), notifCleaning: state.getIn(['notifications', 'cleaningMode']), }); - - return mapStateToProps; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -export default connect(makeMapStateToProps)(Notification); +export default connect(mapStateToProps)(Notification); diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 8cd5abd3f..232eccf70 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -11,7 +11,7 @@ import Link from 'react-router-dom/Link'; import { FormattedDate, FormattedNumber } from 'react-intl'; import CardContainer from '../containers/card_container'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import Video from '../../video'; +// import Video from '../../video'; import VisibilityIcon from '../../../../glitch/components/status/visibility_icon'; export default class DetailedStatus extends ImmutablePureComponent { @@ -37,9 +37,9 @@ export default class DetailedStatus extends ImmutablePureComponent { e.stopPropagation(); } - handleOpenVideo = startTime => { - this.props.onOpenVideo(this.props.status.getIn(['media_attachments', 0]), startTime); - } + // handleOpenVideo = startTime => { + // this.props.onOpenVideo(this.props.status.getIn(['media_attachments', 0]), startTime); + // } render () { const status = this.props.status.get('reblog') ? this.props.status.get('reblog') : this.props.status; |