From 6bf7151745b1d2ae42f96dd68883b0f298bd05e8 Mon Sep 17 00:00:00 2001 From: yash-signal Date: Tue, 19 Nov 2024 11:26:51 -0600 Subject: [PATCH] Limit Filter by Unread to non production --- ts/components/LeftPaneSearchInput.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ts/components/LeftPaneSearchInput.tsx b/ts/components/LeftPaneSearchInput.tsx index e361f2bb15ec..c97c29c900ab 100644 --- a/ts/components/LeftPaneSearchInput.tsx +++ b/ts/components/LeftPaneSearchInput.tsx @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // 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 type { ConversationType, @@ -13,6 +13,7 @@ import { SearchInput } from './SearchInput'; import { usePrevious } from '../hooks/usePrevious'; import { Tooltip, TooltipPlacement } from './Tooltip'; import { Theme } from '../util/theme'; +import { isProduction } from '../util/version'; type BasePropsType = { clearConversationSearch: () => void; @@ -123,6 +124,11 @@ export function LeftPaneSearchInput({ label = i18n('icu:search'); } + const eligibleToShowFilterByUnread = useMemo( + () => window.getVersion && !isProduction(window.getVersion()), + [] + ); + return ( <> )} - {filterButtonEnabled && ( + {filterButtonEnabled && eligibleToShowFilterByUnread && (