|
|
@ -41,7 +41,7 @@ import { openModal } from '../../actions/modal'; |
|
|
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; |
|
|
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; |
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'; |
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'; |
|
|
|
import { HotKeys } from 'react-hotkeys'; |
|
|
|
import { HotKeys } from 'react-hotkeys'; |
|
|
|
import { boostModal, deleteModal } from '../../initial_state'; |
|
|
|
import { boostModal, deleteModal, displayMedia } from '../../initial_state'; |
|
|
|
import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../ui/util/fullscreen'; |
|
|
|
import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../ui/util/fullscreen'; |
|
|
|
import { textForScreenReader } from '../../components/status'; |
|
|
|
import { textForScreenReader } from '../../components/status'; |
|
|
|
import Icon from 'mastodon/components/icon'; |
|
|
|
import Icon from 'mastodon/components/icon'; |
|
|
@ -131,6 +131,7 @@ class Status extends ImmutablePureComponent { |
|
|
|
|
|
|
|
|
|
|
|
state = { |
|
|
|
state = { |
|
|
|
fullscreen: false, |
|
|
|
fullscreen: false, |
|
|
|
|
|
|
|
showMedia: !this.props.status ? undefined : (displayMedia !== 'hide_all' && !this.props.status.get('sensitive') || displayMedia === 'show_all'), |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
componentWillMount () { |
|
|
|
componentWillMount () { |
|
|
@ -146,6 +147,13 @@ class Status extends ImmutablePureComponent { |
|
|
|
this._scrolledIntoView = false; |
|
|
|
this._scrolledIntoView = false; |
|
|
|
this.props.dispatch(fetchStatus(nextProps.params.statusId)); |
|
|
|
this.props.dispatch(fetchStatus(nextProps.params.statusId)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!Immutable.is(nextProps.status, this.props.status) && nextProps.status) { |
|
|
|
|
|
|
|
this.setState({ showMedia: displayMedia !== 'hide_all' && !nextProps.status.get('sensitive') || displayMedia === 'show_all' }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleToggleMediaVisibility = () => { |
|
|
|
|
|
|
|
this.setState({ showMedia: !this.state.showMedia }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
handleFavouriteClick = (status) => { |
|
|
|
handleFavouriteClick = (status) => { |
|
|
@ -312,6 +320,10 @@ class Status extends ImmutablePureComponent { |
|
|
|
this.handleToggleHidden(this.props.status); |
|
|
|
this.handleToggleHidden(this.props.status); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleHotkeyToggleSensitive = () => { |
|
|
|
|
|
|
|
this.handleToggleMediaVisibility(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
handleMoveUp = id => { |
|
|
|
handleMoveUp = id => { |
|
|
|
const { status, ancestorsIds, descendantsIds } = this.props; |
|
|
|
const { status, ancestorsIds, descendantsIds } = this.props; |
|
|
|
|
|
|
|
|
|
|
@ -432,6 +444,7 @@ class Status extends ImmutablePureComponent { |
|
|
|
mention: this.handleHotkeyMention, |
|
|
|
mention: this.handleHotkeyMention, |
|
|
|
openProfile: this.handleHotkeyOpenProfile, |
|
|
|
openProfile: this.handleHotkeyOpenProfile, |
|
|
|
toggleHidden: this.handleHotkeyToggleHidden, |
|
|
|
toggleHidden: this.handleHotkeyToggleHidden, |
|
|
|
|
|
|
|
toggleSensitive: this.handleHotkeyToggleSensitive, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -455,6 +468,8 @@ class Status extends ImmutablePureComponent { |
|
|
|
onOpenMedia={this.handleOpenMedia} |
|
|
|
onOpenMedia={this.handleOpenMedia} |
|
|
|
onToggleHidden={this.handleToggleHidden} |
|
|
|
onToggleHidden={this.handleToggleHidden} |
|
|
|
domain={domain} |
|
|
|
domain={domain} |
|
|
|
|
|
|
|
showMedia={this.state.showMedia} |
|
|
|
|
|
|
|
onToggleMediaVisibility={this.handleToggleMediaVisibility} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<ActionBar |
|
|
|
<ActionBar |
|
|
|