[Glitch] Fix keyboard shortcuts and navigation in grouped notifications

Port af06d74574 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire 2024-07-23 08:20:17 +02:00
commit 838ea5f9cd
7 changed files with 191 additions and 66 deletions

View file

@ -1,3 +1,5 @@
import { browserHistory } from 'flavours/glitch/components/router';
import api from '../api';
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
@ -364,3 +366,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}`);
}
};
};