diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 6129b3f1e..e5f7c9399 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -122,6 +122,10 @@ export default class Status extends ImmutablePureComponent { this.props.onMoveDown(this.props.status.get('id')); } + handleHotkeyToggleHidden = () => { + this.props.onToggleHidden(this._properStatus()); + } + _properStatus () { const { status } = this.props; @@ -224,6 +228,7 @@ export default class Status extends ImmutablePureComponent { openProfile: this.handleHotkeyOpenProfile, moveUp: this.handleHotkeyMoveUp, moveDown: this.handleHotkeyMoveDown, + toggleHidden: this.handleHotkeyToggleHidden, }; return ( diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js index 55eff0823..d5af2a459 100644 --- a/app/javascript/mastodon/features/status/index.js +++ b/app/javascript/mastodon/features/status/index.js @@ -244,6 +244,10 @@ export default class Status extends ImmutablePureComponent { this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); } + handleHotkeyToggleHidden = () => { + this.handleToggleHidden(this.props.status); + } + handleMoveUp = id => { const { status, ancestorsIds, descendantsIds } = this.props; @@ -354,6 +358,7 @@ export default class Status extends ImmutablePureComponent { boost: this.handleHotkeyBoost, mention: this.handleHotkeyMention, openProfile: this.handleHotkeyOpenProfile, + toggleHidden: this.handleHotkeyToggleHidden, }; return ( diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js index 8b905fa1d..d2ef19e47 100644 --- a/app/javascript/mastodon/features/ui/index.js +++ b/app/javascript/mastodon/features/ui/index.js @@ -85,6 +85,7 @@ const keyMap = { goToProfile: 'g u', goToBlocked: 'g b', goToMuted: 'g m', + toggleHidden: 'x', }; class SwitchingColumnsArea extends React.PureComponent {