mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-22 10:33:48 -05:00
Merge commit '28411acebb5626acf43b44a7b6c33ac783156f72' into glitch-soc/merge-upstream
This commit is contained in:
commit
f43a4842f7
@ -74,9 +74,39 @@ const SelectRow = ({selectAllChecked, toggleSelectAll, selectedItems, selectionM
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const notificationRequests = useSelector(state => state.getIn(['notificationRequests', 'items']));
|
||||||
|
|
||||||
const selectedCount = selectedItems.length;
|
const selectedCount = selectedItems.length;
|
||||||
|
|
||||||
const handleAcceptAll = useCallback(() => {
|
const handleAcceptAll = useCallback(() => {
|
||||||
|
const items = notificationRequests.map(request => request.get('id')).toArray();
|
||||||
|
dispatch(openModal({
|
||||||
|
modalType: 'CONFIRM',
|
||||||
|
modalProps: {
|
||||||
|
title: intl.formatMessage(messages.confirmAcceptAllTitle),
|
||||||
|
message: intl.formatMessage(messages.confirmAcceptAllMessage, { count: items.length }),
|
||||||
|
confirm: intl.formatMessage(messages.confirmAcceptAllButton),
|
||||||
|
onConfirm: () =>
|
||||||
|
dispatch(acceptNotificationRequests(items)),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
}, [dispatch, intl, notificationRequests]);
|
||||||
|
|
||||||
|
const handleDismissAll = useCallback(() => {
|
||||||
|
const items = notificationRequests.map(request => request.get('id')).toArray();
|
||||||
|
dispatch(openModal({
|
||||||
|
modalType: 'CONFIRM',
|
||||||
|
modalProps: {
|
||||||
|
title: intl.formatMessage(messages.confirmDismissAllTitle),
|
||||||
|
message: intl.formatMessage(messages.confirmDismissAllMessage, { count: items.length }),
|
||||||
|
confirm: intl.formatMessage(messages.confirmDismissAllButton),
|
||||||
|
onConfirm: () =>
|
||||||
|
dispatch(dismissNotificationRequests(items)),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
}, [dispatch, intl, notificationRequests]);
|
||||||
|
|
||||||
|
const handleAcceptMultiple = useCallback(() => {
|
||||||
dispatch(openModal({
|
dispatch(openModal({
|
||||||
modalType: 'CONFIRM',
|
modalType: 'CONFIRM',
|
||||||
modalProps: {
|
modalProps: {
|
||||||
@ -89,7 +119,7 @@ const SelectRow = ({selectAllChecked, toggleSelectAll, selectedItems, selectionM
|
|||||||
}));
|
}));
|
||||||
}, [dispatch, intl, selectedItems]);
|
}, [dispatch, intl, selectedItems]);
|
||||||
|
|
||||||
const handleDismissAll = useCallback(() => {
|
const handleDismissMultiple = useCallback(() => {
|
||||||
dispatch(openModal({
|
dispatch(openModal({
|
||||||
modalType: 'CONFIRM',
|
modalType: 'CONFIRM',
|
||||||
modalProps: {
|
modalProps: {
|
||||||
@ -111,8 +141,8 @@ const SelectRow = ({selectAllChecked, toggleSelectAll, selectedItems, selectionM
|
|||||||
{ text: intl.formatMessage(messages.acceptAll), action: handleAcceptAll },
|
{ text: intl.formatMessage(messages.acceptAll), action: handleAcceptAll },
|
||||||
{ text: intl.formatMessage(messages.dismissAll), action: handleDismissAll },
|
{ text: intl.formatMessage(messages.dismissAll), action: handleDismissAll },
|
||||||
] : [
|
] : [
|
||||||
{ text: intl.formatMessage(messages.acceptMultiple, { count: selectedCount }), action: handleAcceptAll },
|
{ text: intl.formatMessage(messages.acceptMultiple, { count: selectedCount }), action: handleAcceptMultiple },
|
||||||
{ text: intl.formatMessage(messages.dismissMultiple, { count: selectedCount }), action: handleDismissAll },
|
{ text: intl.formatMessage(messages.dismissMultiple, { count: selectedCount }), action: handleDismissMultiple },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
@ -18,6 +18,7 @@ import VisibilityIcon from '@/material-icons/400-24px/visibility.svg?react';
|
|||||||
import VisibilityOffIcon from '@/material-icons/400-24px/visibility_off.svg?react';
|
import VisibilityOffIcon from '@/material-icons/400-24px/visibility_off.svg?react';
|
||||||
import { Icon } from 'mastodon/components/icon';
|
import { Icon } from 'mastodon/components/icon';
|
||||||
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
|
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
|
||||||
|
import { TimelineHint } from 'mastodon/components/timeline_hint';
|
||||||
import ScrollContainer from 'mastodon/containers/scroll_container';
|
import ScrollContainer from 'mastodon/containers/scroll_container';
|
||||||
import BundleColumnError from 'mastodon/features/ui/components/bundle_column_error';
|
import BundleColumnError from 'mastodon/features/ui/components/bundle_column_error';
|
||||||
import { identityContextPropShape, withIdentity } from 'mastodon/identity_context';
|
import { identityContextPropShape, withIdentity } from 'mastodon/identity_context';
|
||||||
@ -598,7 +599,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let ancestors, descendants;
|
let ancestors, descendants, remoteHint;
|
||||||
const { isLoading, status, ancestorsIds, descendantsIds, intl, domain, multiColumn, pictureInPicture } = this.props;
|
const { isLoading, status, ancestorsIds, descendantsIds, intl, domain, multiColumn, pictureInPicture } = this.props;
|
||||||
const { fullscreen } = this.state;
|
const { fullscreen } = this.state;
|
||||||
|
|
||||||
@ -627,6 +628,10 @@ class Status extends ImmutablePureComponent {
|
|||||||
const isLocal = status.getIn(['account', 'acct'], '').indexOf('@') === -1;
|
const isLocal = status.getIn(['account', 'acct'], '').indexOf('@') === -1;
|
||||||
const isIndexable = !status.getIn(['account', 'noindex']);
|
const isIndexable = !status.getIn(['account', 'noindex']);
|
||||||
|
|
||||||
|
if (!isLocal) {
|
||||||
|
remoteHint = <TimelineHint url={status.get('url')} resource={<FormattedMessage id='timeline_hint.resources.replies' defaultMessage='Some replies' />} />;
|
||||||
|
}
|
||||||
|
|
||||||
const handlers = {
|
const handlers = {
|
||||||
moveUp: this.handleHotkeyMoveUp,
|
moveUp: this.handleHotkeyMoveUp,
|
||||||
moveDown: this.handleHotkeyMoveDown,
|
moveDown: this.handleHotkeyMoveDown,
|
||||||
@ -695,6 +700,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
</HotKeys>
|
</HotKeys>
|
||||||
|
|
||||||
{descendants}
|
{descendants}
|
||||||
|
{remoteHint}
|
||||||
</div>
|
</div>
|
||||||
</ScrollContainer>
|
</ScrollContainer>
|
||||||
|
|
||||||
|
@ -831,6 +831,7 @@
|
|||||||
"timeline_hint.remote_resource_not_displayed": "{resource} from other servers are not displayed.",
|
"timeline_hint.remote_resource_not_displayed": "{resource} from other servers are not displayed.",
|
||||||
"timeline_hint.resources.followers": "Followers",
|
"timeline_hint.resources.followers": "Followers",
|
||||||
"timeline_hint.resources.follows": "Follows",
|
"timeline_hint.resources.follows": "Follows",
|
||||||
|
"timeline_hint.resources.replies": "Some replies",
|
||||||
"timeline_hint.resources.statuses": "Older posts",
|
"timeline_hint.resources.statuses": "Older posts",
|
||||||
"trends.counter_by_accounts": "{count, plural, one {{counter} person} other {{counter} people}} in the past {days, plural, one {day} other {{days} days}}",
|
"trends.counter_by_accounts": "{count, plural, one {{counter} person} other {{counter} people}} in the past {days, plural, one {day} other {{days} days}}",
|
||||||
"trends.trending_now": "Trending now",
|
"trends.trending_now": "Trending now",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user