From f82e90bf11fd147c40f467a0d2eb0097d11898ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 5 Oct 2017 21:55:02 +0200 Subject: [PATCH 1/3] workaround for notif clearing --- .../components/notification/container.js | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/app/javascript/glitch/components/notification/container.js b/app/javascript/glitch/components/notification/container.js index e29d6ba60e..dc4c2168a9 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 '.'; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -/* +const mapStateToProps = (state, props) => { + // replace account id with object + let leNotif = props.notification.set('account', state.getIn(['accounts', props.notification.get('account')])); -State mapping: --------------- + // 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; + } + } -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. - -*/ - -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); From dcd8ff5308d59f7bbf16ce2a62316a5af4d37da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Fri, 6 Oct 2017 09:07:04 +0200 Subject: [PATCH 2/3] fix haml quotes in a bid to make travis less grumpy --- spec/views/about/show.html.haml_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/views/about/show.html.haml_spec.rb b/spec/views/about/show.html.haml_spec.rb index b2f2658de8..ca59fa9e3b 100644 --- a/spec/views/about/show.html.haml_spec.rb +++ b/spec/views/about/show.html.haml_spec.rb @@ -26,9 +26,9 @@ describe 'about/show.html.haml', without_verify_partial_doubles: true do header_tags = view.content_for(:header_tags) - expect(header_tags).to match(%r{}) - expect(header_tags).to match(%r{}) - expect(header_tags).to match(%r{}) - expect(header_tags).to match(%r{}) + expect(header_tags).to match(%r{}) + expect(header_tags).to match(%r{}) + expect(header_tags).to match(%r{}) + expect(header_tags).to match(%r{}) end end From 37e141bccbb72a483b81eab359c19e336fed1029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Fri, 6 Oct 2017 09:23:28 +0200 Subject: [PATCH 3/3] comment out unused stuff with Video --- .../features/status/components/detailed_status.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 8cd5abd3f5..232eccf701 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;