[MM-63664] Fix mentions not paginating (#30671)

Этот коммит содержится в:
Julien Tant
2025-04-15 08:06:27 -07:00
коммит произвёл GitHub
родитель 5b793ad11d
Коммит 77bf047c55
3 изменённых файлов: 83 добавлений и 6 удалений

Просмотреть файл

@@ -174,11 +174,19 @@ const Search: React.FC<Props> = (props: Props): JSX.Element => {
}, [isMobileView, searchTerms]);
const getMorePostsForSearch = useCallback(() => {
props.actions.getMorePostsForSearch(searchTeam);
}, [searchTeam, props.actions]);
let team = searchTeam;
if (props.isMentionSearch) {
team = '';
}
props.actions.getMorePostsForSearch(team);
}, [searchTeam, props.actions, props.isMentionSearch]);
const getMoreFilesForSearch = useCallback(() => {
props.actions.getMoreFilesForSearch(searchTeam);
let team = searchTeam;
if (props.isMentionSearch) {
team = '';
}
props.actions.getMoreFilesForSearch(team);
}, [searchTeam, props.actions]);
// handle cloding of rhs-flyout

Просмотреть файл

@@ -13,7 +13,7 @@ import {makeGetGlobalItem, makeGetGlobalItemWithDefault} from 'selectors/storage
import type {SidebarSize} from 'components/resizable_sidebar/constants';
import {PostTypes, StoragePrefixes} from 'utils/constants';
import {PostTypes, RHSStates, StoragePrefixes} from 'utils/constants';
import {localizeMessage} from 'utils/utils';
import type {GlobalState} from 'types/store';
@@ -113,8 +113,10 @@ export const getCurrentSearchForSearchTeam: (state: GlobalState) => Record<strin
'getCurrentSearchForSearchTeam',
(state: GlobalState) => state.entities.search.current,
getSearchTeam,
(current, teamId) => {
return current[teamId || 'ALL_TEAMS'];
(state: GlobalState) => getRhsState(state) === RHSStates.MENTION,
(current, teamId, isMentionSearch) => {
const team = isMentionSearch ? 'ALL_TEAMS' : teamId || 'ALL_TEAMS';
return current[team];
},
);