[Glitch] Add support for private pinned posts

Port JS changes from 5aade2baac to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
th-downstream
Claire 3 years ago
parent de7f936b96
commit b20dafb566

@ -196,6 +196,7 @@ class StatusActionBar extends ImmutablePureComponent {
const anonymousAccess = !me;
const mutingConversation = status.get('muted');
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
const pinnableStatus = ['public', 'unlisted', 'private'].includes(status.get('visibility'));
const writtenByMe = status.getIn(['account', 'id']) === me;
let menu = [];
@ -212,7 +213,7 @@ class StatusActionBar extends ImmutablePureComponent {
menu.push(null);
if (writtenByMe && publicStatus) {
if (writtenByMe && pinnableStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
menu.push(null);
}

@ -146,6 +146,7 @@ class ActionBar extends React.PureComponent {
const { status, intl } = this.props;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
const pinnableStatus = ['public', 'unlisted', 'private'].includes(status.get('visibility'));
const mutingConversation = status.get('muted');
const writtenByMe = status.getIn(['account', 'id']) === me;
@ -158,7 +159,7 @@ class ActionBar extends React.PureComponent {
}
if (writtenByMe) {
if (publicStatus) {
if (pinnableStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
menu.push(null);
}

Loading…
Cancel
Save