Limit Filter by Unread to non production

This commit is contained in:
yash-signal 2024-11-19 11:26:51 -06:00 committed by GitHub
parent 0c707975d8
commit 6bf7151745
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC // Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only // SPDX-License-Identifier: AGPL-3.0-only
import React, { useEffect, useRef } from 'react'; import React, { useEffect, useMemo, useRef } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import type { import type {
ConversationType, ConversationType,
@ -13,6 +13,7 @@ import { SearchInput } from './SearchInput';
import { usePrevious } from '../hooks/usePrevious'; import { usePrevious } from '../hooks/usePrevious';
import { Tooltip, TooltipPlacement } from './Tooltip'; import { Tooltip, TooltipPlacement } from './Tooltip';
import { Theme } from '../util/theme'; import { Theme } from '../util/theme';
import { isProduction } from '../util/version';
type BasePropsType = { type BasePropsType = {
clearConversationSearch: () => void; clearConversationSearch: () => void;
@ -123,6 +124,11 @@ export function LeftPaneSearchInput({
label = i18n('icu:search'); label = i18n('icu:search');
} }
const eligibleToShowFilterByUnread = useMemo(
() => window.getVersion && !isProduction(window.getVersion()),
[]
);
return ( return (
<> <>
<SearchInput <SearchInput
@ -196,7 +202,7 @@ export function LeftPaneSearchInput({
</div> </div>
)} )}
</SearchInput> </SearchInput>
{filterButtonEnabled && ( {filterButtonEnabled && eligibleToShowFilterByUnread && (
<Tooltip <Tooltip
direction={TooltipPlacement.Bottom} direction={TooltipPlacement.Bottom}
content={i18n('icu:filterByUnreadButtonLabel')} content={i18n('icu:filterByUnreadButtonLabel')}