[MM-63664] Fix mentions not paginating (#30671)
Этот коммит содержится в:
@@ -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];
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user