Fix keyboard shortcuts and navigation in grouped notifications (#31076)

This commit is contained in:
Claire 2024-07-23 08:20:17 +02:00 committed by GitHub
parent 55705d8191
commit af06d74574
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 188 additions and 66 deletions

View file

@ -1,3 +1,5 @@
import { browserHistory } from 'mastodon/components/router';
import api from '../api';
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
@ -363,3 +365,15 @@ export const undoStatusTranslation = (id, pollId) => ({
id,
pollId,
});
export const navigateToStatus = (statusId) => {
return (_dispatch, getState) => {
const state = getState();
const accountId = state.statuses.getIn([statusId, 'account']);
const acct = state.accounts.getIn([accountId, 'acct']);
if (acct) {
browserHistory.push(`/@${acct}/${statusId}`);
}
};
};