Skip to content

Commit 25a50bd

Browse files
authored
Regression: Fix not showing global search option (RocketChat#28342)
1 parent 40764bc commit 25a50bd

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

apps/meteor/client/views/room/contextualBar/MessageSearchTab/components/MessageSearchForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { IMessageSearchProvider } from '@rocket.chat/core-typings';
22
import { Box, Field, Icon, TextInput, ToggleSwitch } from '@rocket.chat/fuselage';
33
import { useDebouncedCallback, useMutableCallback, useUniqueId } from '@rocket.chat/fuselage-hooks';
44
import type { TranslationKey } from '@rocket.chat/ui-contexts';
5-
import { useSetting, useTranslation } from '@rocket.chat/ui-contexts';
5+
import { useTranslation } from '@rocket.chat/ui-contexts';
66
import React, { useEffect } from 'react';
77
import { useForm, useWatch } from 'react-hook-form';
88

@@ -37,7 +37,7 @@ const MessageSearchForm = ({ provider, onSearch }: MessageSearchFormProps) => {
3737
debouncedOnSearch({ searchText, globalSearch });
3838
}, [debouncedOnSearch, searchText, globalSearch]);
3939

40-
const globalSearchEnabled = useSetting<boolean>('GlobalSearchEnabled') ?? false;
40+
const globalSearchEnabled = provider.settings.GlobalSearchEnabled;
4141
const globalSearchToggleId = useUniqueId();
4242

4343
const t = useTranslation();
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import type { ISetting } from '../ISetting';
2-
31
export interface IMessageSearchProvider {
42
key: string;
53
description: string;
64
icon: string;
75
resultTemplate: string;
86
supportsSuggestions: boolean;
97
suggestionItemTemplate?: string;
10-
settings: Record<ISetting['_id'], ISetting['value']>;
8+
settings: { GlobalSearchEnabled: boolean } & { PageSize: number };
119
}

0 commit comments

Comments
 (0)