Skip to content

Commit 6bf7151

Browse files
authored
Limit Filter by Unread to non production
1 parent 0c70797 commit 6bf7151

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ts/components/LeftPaneSearchInput.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2021 Signal Messenger, LLC
22
// SPDX-License-Identifier: AGPL-3.0-only
33

4-
import React, { useEffect, useRef } from 'react';
4+
import React, { useEffect, useMemo, useRef } from 'react';
55
import classNames from 'classnames';
66
import type {
77
ConversationType,
@@ -13,6 +13,7 @@ import { SearchInput } from './SearchInput';
1313
import { usePrevious } from '../hooks/usePrevious';
1414
import { Tooltip, TooltipPlacement } from './Tooltip';
1515
import { Theme } from '../util/theme';
16+
import { isProduction } from '../util/version';
1617

1718
type BasePropsType = {
1819
clearConversationSearch: () => void;
@@ -123,6 +124,11 @@ export function LeftPaneSearchInput({
123124
label = i18n('icu:search');
124125
}
125126

127+
const eligibleToShowFilterByUnread = useMemo(
128+
() => window.getVersion && !isProduction(window.getVersion()),
129+
[]
130+
);
131+
126132
return (
127133
<>
128134
<SearchInput
@@ -196,7 +202,7 @@ export function LeftPaneSearchInput({
196202
</div>
197203
)}
198204
</SearchInput>
199-
{filterButtonEnabled && (
205+
{filterButtonEnabled && eligibleToShowFilterByUnread && (
200206
<Tooltip
201207
direction={TooltipPlacement.Bottom}
202208
content={i18n('icu:filterByUnreadButtonLabel')}

0 commit comments

Comments
 (0)