From 5f63b8d40f7ede8bbaaf1d1f68200126896f061b Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 7 Jun 2024 19:17:00 -0700 Subject: [PATCH 1/7] Bump `expo-notifications` to fix NPE (#4425) * bump library * rename patch file --- package.json | 2 +- ...tions+0.28.3.patch => expo-notifications+0.28.7.patch} | 0 ...0.28.3.patch.md => expo-notifications-0.28.7.patch.md} | 0 yarn.lock | 8 ++++---- 4 files changed, 5 insertions(+), 5 deletions(-) rename patches/{expo-notifications+0.28.3.patch => expo-notifications+0.28.7.patch} (100%) rename patches/{expo-notifications-0.28.3.patch.md => expo-notifications-0.28.7.patch.md} (100%) diff --git a/package.json b/package.json index 458baa2828..1ba0ab2ec8 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "expo-localization": "~15.0.3", "expo-media-library": "~16.0.3", "expo-navigation-bar": "~3.0.4", - "expo-notifications": "~0.28.3", + "expo-notifications": "~0.28.7", "expo-sharing": "^12.0.1", "expo-splash-screen": "~0.27.4", "expo-status-bar": "~1.12.1", diff --git a/patches/expo-notifications+0.28.3.patch b/patches/expo-notifications+0.28.7.patch similarity index 100% rename from patches/expo-notifications+0.28.3.patch rename to patches/expo-notifications+0.28.7.patch diff --git a/patches/expo-notifications-0.28.3.patch.md b/patches/expo-notifications-0.28.7.patch.md similarity index 100% rename from patches/expo-notifications-0.28.3.patch.md rename to patches/expo-notifications-0.28.7.patch.md diff --git a/yarn.lock b/yarn.lock index bf88287565..321cd746dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12180,10 +12180,10 @@ expo-navigation-bar@~3.0.4: "@react-native/normalize-colors" "~0.74.83" debug "^4.3.2" -expo-notifications@~0.28.3: - version "0.28.3" - resolved "https://registry.yarnpkg.com/expo-notifications/-/expo-notifications-0.28.3.tgz#9076c2bd69c3de3338a2e2161c8bd5f18cb440cb" - integrity sha512-Xaj82eQUJzJXa8+giZr708ih86GGtkGS8N01epoiDkTKC8Z9783UJ8Pf8+PSFSfHsY3Sd8TJpQrD9n7QnGHwGQ== +expo-notifications@~0.28.7: + version "0.28.7" + resolved "https://registry.yarnpkg.com/expo-notifications/-/expo-notifications-0.28.7.tgz#14826c10d126b1dd16d1604add2a4766aecf7591" + integrity sha512-P68/IlnxTtKjfHy22nC+o/H4VSgBVrmTQcx42JCevTbVQB8JTITmR42hvpZh8GUecB7jNOsuVokTTDZDE6aSyg== dependencies: "@expo/image-utils" "^0.5.0" "@ide/backoff" "^1.0.0" From a2d1cf68b9cf6b2d935439e522c838359a94a9a4 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 8 Jun 2024 06:27:16 +0100 Subject: [PATCH 2/7] Reliably focus keyboard on Android (#4427) --- src/view/com/composer/Composer.tsx | 32 +++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 7872ea1866..fac08a7113 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -405,13 +405,31 @@ export const ComposePost = observer(function ComposePost({ // Backup focus on android, if the keyboard *still* refuses to show useEffect(() => { if (!isAndroid) return - if (isModalReady) { - setTimeout(() => { - if (!Keyboard.isVisible()) { - textInput.current?.blur() - textInput.current?.focus() - } - }, 300) + if (!isModalReady) return + + function tryFocus() { + if (!Keyboard.isVisible()) { + textInput.current?.blur() + textInput.current?.focus() + } + } + + tryFocus() + // Retry with enough gap to avoid interrupting the previous attempt. + // Unfortunately we don't know which attempt will succeed. + const retryInterval = setInterval(tryFocus, 500) + + function stopTrying() { + clearInterval(retryInterval) + } + + // Deactivate this fallback as soon as anything happens. + const sub1 = Keyboard.addListener('keyboardDidShow', stopTrying) + const sub2 = Keyboard.addListener('keyboardDidHide', stopTrying) + return () => { + clearInterval(retryInterval) + sub1.remove() + sub2.remove() } }, [isModalReady]) From 01b7a94a7eb95e9cf74fdcfe9cc350e62d0f7be2 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 8 Jun 2024 09:55:57 +0100 Subject: [PATCH 3/7] Patch to work around a crash in RN internals (#4426) Co-authored-by: Hailey --- patches/react-native+0.74.1.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patches/react-native+0.74.1.patch b/patches/react-native+0.74.1.patch index db8b7da2d2..5d2900a731 100644 --- a/patches/react-native+0.74.1.patch +++ b/patches/react-native+0.74.1.patch @@ -67,3 +67,19 @@ index b09e653..4c32b31 100644 +} + @end +diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +index 5f5e1ab..aac00b6 100644 +--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java ++++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +@@ -99,8 +99,9 @@ public class JavaTimerManager { + } + + // If the JS thread is busy for multiple frames we cancel any other pending runnable. +- if (mCurrentIdleCallbackRunnable != null) { +- mCurrentIdleCallbackRunnable.cancel(); ++ IdleCallbackRunnable currentRunnable = mCurrentIdleCallbackRunnable; ++ if (currentRunnable != null) { ++ currentRunnable.cancel(); + } + + mCurrentIdleCallbackRunnable = new IdleCallbackRunnable(frameTimeNanos); From 1317d881ed2f583a65bffeb835b2d57670cce235 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 10 Jun 2024 15:08:13 +0100 Subject: [PATCH 4/7] debounce refetching listconvos (#4455) --- .../queries/messages/list-converations.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/state/queries/messages/list-converations.tsx b/src/state/queries/messages/list-converations.tsx index ce2cd70798..306d4cae5a 100644 --- a/src/state/queries/messages/list-converations.tsx +++ b/src/state/queries/messages/list-converations.tsx @@ -16,6 +16,7 @@ import { useInfiniteQuery, useQueryClient, } from '@tanstack/react-query' +import debounce from 'lodash.debounce' import {useCurrentConvoId} from '#/state/messages/current-convo-id' import {useMessagesEventBus} from '#/state/messages/events' @@ -89,6 +90,11 @@ export function ListConvosProviderInner({ const {currentConvoId} = useCurrentConvoId() const {currentAccount} = useSession() + const debouncedRefetch = useMemo( + () => debounce(() => refetch, 500), + [refetch], + ) + useEffect(() => { const unsub = messagesBus.on( events => { @@ -96,7 +102,7 @@ export function ListConvosProviderInner({ events.logs.forEach(log => { if (ChatBskyConvoDefs.isLogBeginConvo(log)) { - refetch() + debouncedRefetch() } else if (ChatBskyConvoDefs.isLogLeaveConvo(log)) { queryClient.setQueryData(RQKEY, (old: ConvoListQueryData) => optimisticDelete(log.convoId, old), @@ -170,7 +176,7 @@ export function ListConvosProviderInner({ }), } } else { - refetch() + debouncedRefetch() } }) } @@ -183,7 +189,14 @@ export function ListConvosProviderInner({ ) return () => unsub() - }, [messagesBus, currentConvoId, refetch, queryClient, currentAccount?.did]) + }, [ + messagesBus, + currentConvoId, + refetch, + queryClient, + currentAccount?.did, + debouncedRefetch, + ]) const ctx = useMemo(() => { return data?.pages.flatMap(page => page.convos) ?? [] From fd03ea3fe1d4f3c6a4079272b0dbd21c4e0d2b1b Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 10 Jun 2024 16:02:57 +0100 Subject: [PATCH 5/7] Throttle instead of debounce (#4456) * throttle instead of debounce * trailing: true * Fix throttle call --------- Co-authored-by: Dan Abramov --- src/state/queries/messages/list-converations.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/state/queries/messages/list-converations.tsx b/src/state/queries/messages/list-converations.tsx index 306d4cae5a..eeab246ab3 100644 --- a/src/state/queries/messages/list-converations.tsx +++ b/src/state/queries/messages/list-converations.tsx @@ -16,7 +16,7 @@ import { useInfiniteQuery, useQueryClient, } from '@tanstack/react-query' -import debounce from 'lodash.debounce' +import throttle from 'lodash.throttle' import {useCurrentConvoId} from '#/state/messages/current-convo-id' import {useMessagesEventBus} from '#/state/messages/events' @@ -91,7 +91,11 @@ export function ListConvosProviderInner({ const {currentAccount} = useSession() const debouncedRefetch = useMemo( - () => debounce(() => refetch, 500), + () => + throttle(refetch, 500, { + leading: true, + trailing: true, + }), [refetch], ) From b688da8d5860569108a7f487dc97c5f0b403aee1 Mon Sep 17 00:00:00 2001 From: Francesco Lodovici <2643961+frncs-eu@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:19:28 +0200 Subject: [PATCH 6/7] Fix (#4430): Use separate hooks for shell mode animated styles (#4451) * Fix (#4430): Use separate hooks for shell mode animated styles * Consolidate in one file --------- Co-authored-by: Dan Abramov --- ...llMode.tsx => useMinimalShellTransform.ts} | 57 ++++++++++++------- src/view/com/home/HomeHeaderLayout.web.tsx | 4 +- src/view/com/home/HomeHeaderLayoutMobile.tsx | 4 +- src/view/com/util/ViewHeader.tsx | 4 +- src/view/com/util/fab/FABInner.tsx | 4 +- .../com/util/load-latest/LoadLatestBtn.tsx | 4 +- src/view/screens/PostThread.tsx | 4 +- src/view/shell/bottom-bar/BottomBar.tsx | 4 +- src/view/shell/bottom-bar/BottomBarWeb.tsx | 4 +- 9 files changed, 51 insertions(+), 38 deletions(-) rename src/lib/hooks/{useMinimalShellMode.tsx => useMinimalShellTransform.ts} (51%) diff --git a/src/lib/hooks/useMinimalShellMode.tsx b/src/lib/hooks/useMinimalShellTransform.ts similarity index 51% rename from src/lib/hooks/useMinimalShellMode.tsx rename to src/lib/hooks/useMinimalShellTransform.ts index e81fc434fe..9875840d65 100644 --- a/src/lib/hooks/useMinimalShellMode.tsx +++ b/src/lib/hooks/useMinimalShellTransform.ts @@ -1,23 +1,15 @@ import {interpolate, useAnimatedStyle} from 'react-native-reanimated' -import {useMinimalShellMode as useMinimalShellModeState} from '#/state/shell/minimal-mode' + +import {useMinimalShellMode} from '#/state/shell/minimal-mode' import {useShellLayout} from '#/state/shell/shell-layout' -export function useMinimalShellMode() { - const mode = useMinimalShellModeState() - const {footerHeight, headerHeight} = useShellLayout() +// Keep these separated so that we only pay for useAnimatedStyle that gets used. - const footerMinimalShellTransform = useAnimatedStyle(() => { - return { - pointerEvents: mode.value === 0 ? 'auto' : 'none', - opacity: Math.pow(1 - mode.value, 2), - transform: [ - { - translateY: interpolate(mode.value, [0, 1], [0, footerHeight.value]), - }, - ], - } - }) - const headerMinimalShellTransform = useAnimatedStyle(() => { +export function useMinimalShellHeaderTransform() { + const mode = useMinimalShellMode() + const {headerHeight} = useShellLayout() + + const headerTransform = useAnimatedStyle(() => { return { pointerEvents: mode.value === 0 ? 'auto' : 'none', opacity: Math.pow(1 - mode.value, 2), @@ -28,7 +20,32 @@ export function useMinimalShellMode() { ], } }) - const fabMinimalShellTransform = useAnimatedStyle(() => { + + return headerTransform +} + +export function useMinimalShellFooterTransform() { + const mode = useMinimalShellMode() + const {footerHeight} = useShellLayout() + + const footerTransform = useAnimatedStyle(() => { + return { + pointerEvents: mode.value === 0 ? 'auto' : 'none', + opacity: Math.pow(1 - mode.value, 2), + transform: [ + { + translateY: interpolate(mode.value, [0, 1], [0, footerHeight.value]), + }, + ], + } + }) + return footerTransform +} + +export function useMinimalShellFabTransform() { + const mode = useMinimalShellMode() + + const fabTransform = useAnimatedStyle(() => { return { transform: [ { @@ -37,9 +54,5 @@ export function useMinimalShellMode() { ], } }) - return { - footerMinimalShellTransform, - headerMinimalShellTransform, - fabMinimalShellTransform, - } + return fabTransform } diff --git a/src/view/com/home/HomeHeaderLayout.web.tsx b/src/view/com/home/HomeHeaderLayout.web.tsx index f00a15b3f4..474fc392da 100644 --- a/src/view/com/home/HomeHeaderLayout.web.tsx +++ b/src/view/com/home/HomeHeaderLayout.web.tsx @@ -11,7 +11,7 @@ import {useLingui} from '@lingui/react' import {CogIcon} from '#/lib/icons' import {useSession} from '#/state/session' import {useShellLayout} from '#/state/shell/shell-layout' -import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode' +import {useMinimalShellHeaderTransform} from 'lib/hooks/useMinimalShellTransform' import {usePalette} from 'lib/hooks/usePalette' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {Logo} from '#/view/icons/Logo' @@ -39,7 +39,7 @@ function HomeHeaderLayoutDesktopAndTablet({ tabBarAnchor: JSX.Element | null | undefined }) { const pal = usePalette('default') - const {headerMinimalShellTransform} = useMinimalShellMode() + const headerMinimalShellTransform = useMinimalShellHeaderTransform() const {headerHeight} = useShellLayout() const {hasSession} = useSession() const {_} = useLingui() diff --git a/src/view/com/home/HomeHeaderLayoutMobile.tsx b/src/view/com/home/HomeHeaderLayoutMobile.tsx index 78fa9af865..5ce1d80a72 100644 --- a/src/view/com/home/HomeHeaderLayoutMobile.tsx +++ b/src/view/com/home/HomeHeaderLayoutMobile.tsx @@ -10,7 +10,7 @@ import {useSession} from '#/state/session' import {useSetDrawerOpen} from '#/state/shell/drawer-open' import {useShellLayout} from '#/state/shell/shell-layout' import {HITSLOP_10} from 'lib/constants' -import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode' +import {useMinimalShellHeaderTransform} from 'lib/hooks/useMinimalShellTransform' import {usePalette} from 'lib/hooks/usePalette' import {isWeb} from 'platform/detection' import {Logo} from '#/view/icons/Logo' @@ -30,7 +30,7 @@ export function HomeHeaderLayoutMobile({ const {_} = useLingui() const setDrawerOpen = useSetDrawerOpen() const {headerHeight} = useShellLayout() - const {headerMinimalShellTransform} = useMinimalShellMode() + const headerMinimalShellTransform = useMinimalShellHeaderTransform() const {hasSession} = useSession() const onPressAvi = React.useCallback(() => { diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx index 4c0f0e3e5c..95b6e290c8 100644 --- a/src/view/com/util/ViewHeader.tsx +++ b/src/view/com/util/ViewHeader.tsx @@ -8,7 +8,7 @@ import {useNavigation} from '@react-navigation/native' import {useSetDrawerOpen} from '#/state/shell' import {useAnalytics} from 'lib/analytics/analytics' -import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode' +import {useMinimalShellHeaderTransform} from 'lib/hooks/useMinimalShellTransform' import {usePalette} from 'lib/hooks/usePalette' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {NavigationProp} from 'lib/routes/types' @@ -197,7 +197,7 @@ function Container({ showBorder?: boolean }) { const pal = usePalette('default') - const {headerMinimalShellTransform} = useMinimalShellMode() + const headerMinimalShellTransform = useMinimalShellHeaderTransform() if (!hideOnScroll) { return ( diff --git a/src/view/com/util/fab/FABInner.tsx b/src/view/com/util/fab/FABInner.tsx index c9443127b8..e6fb0ad465 100644 --- a/src/view/com/util/fab/FABInner.tsx +++ b/src/view/com/util/fab/FABInner.tsx @@ -4,7 +4,7 @@ import Animated, {useAnimatedStyle, withTiming} from 'react-native-reanimated' import {useSafeAreaInsets} from 'react-native-safe-area-context' import {LinearGradient} from 'expo-linear-gradient' -import {useMinimalShellMode} from '#/lib/hooks/useMinimalShellMode' +import {useMinimalShellFabTransform} from '#/lib/hooks/useMinimalShellTransform' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {clamp} from '#/lib/numbers' import {gradients} from '#/lib/styles' @@ -20,7 +20,7 @@ export interface FABProps export function FABInner({testID, icon, ...props}: FABProps) { const insets = useSafeAreaInsets() const {isMobile, isTablet} = useWebMediaQueries() - const {fabMinimalShellTransform} = useMinimalShellMode() + const fabMinimalShellTransform = useMinimalShellFabTransform() const { state: pressed, onIn: onPressIn, diff --git a/src/view/com/util/load-latest/LoadLatestBtn.tsx b/src/view/com/util/load-latest/LoadLatestBtn.tsx index a6b40f9f52..9de03a4f33 100644 --- a/src/view/com/util/load-latest/LoadLatestBtn.tsx +++ b/src/view/com/util/load-latest/LoadLatestBtn.tsx @@ -6,7 +6,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {useMediaQuery} from 'react-responsive' import {HITSLOP_20} from '#/lib/constants' -import {useMinimalShellMode} from '#/lib/hooks/useMinimalShellMode' +import {useMinimalShellFabTransform} from '#/lib/hooks/useMinimalShellTransform' import {usePalette} from '#/lib/hooks/usePalette' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {clamp} from '#/lib/numbers' @@ -30,7 +30,7 @@ export function LoadLatestBtn({ const pal = usePalette('default') const {hasSession} = useSession() const {isDesktop, isTablet, isMobile, isTabletOrMobile} = useWebMediaQueries() - const {fabMinimalShellTransform} = useMinimalShellMode() + const fabMinimalShellTransform = useMinimalShellFabTransform() const insets = useSafeAreaInsets() // move button inline if it starts overlapping the left nav diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx index 70378f4b81..89234c46b8 100644 --- a/src/view/screens/PostThread.tsx +++ b/src/view/screens/PostThread.tsx @@ -14,7 +14,7 @@ import { import {useSession} from '#/state/session' import {useSetMinimalShellMode} from '#/state/shell' import {useComposerControls} from '#/state/shell/composer' -import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode' +import {useMinimalShellFabTransform} from 'lib/hooks/useMinimalShellTransform' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {CommonNavigatorParams, NativeStackScreenProps} from 'lib/routes/types' import {makeRecordUri} from 'lib/strings/url-helpers' @@ -26,7 +26,7 @@ type Props = NativeStackScreenProps export function PostThreadScreen({route}: Props) { const queryClient = useQueryClient() const {hasSession} = useSession() - const {fabMinimalShellTransform} = useMinimalShellMode() + const fabMinimalShellTransform = useMinimalShellFabTransform() const setMinimalShellMode = useSetMinimalShellMode() const {openComposer} = useComposerControls() const safeAreaInsets = useSafeAreaInsets() diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index 0a7897f17e..b5ad92b4c4 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -10,7 +10,7 @@ import {StackActions} from '@react-navigation/native' import {useAnalytics} from '#/lib/analytics/analytics' import {useHaptics} from '#/lib/haptics' import {useDedupe} from '#/lib/hooks/useDedupe' -import {useMinimalShellMode} from '#/lib/hooks/useMinimalShellMode' +import {useMinimalShellFooterTransform} from '#/lib/hooks/useMinimalShellTransform' import {useNavigationTabState} from '#/lib/hooks/useNavigationTabState' import {usePalette} from '#/lib/hooks/usePalette' import {clamp} from '#/lib/numbers' @@ -66,7 +66,7 @@ export function BottomBar({navigation}: BottomTabBarProps) { useNavigationTabState() const numUnreadNotifications = useUnreadNotifications() const numUnreadMessages = useUnreadMessageCount() - const {footerMinimalShellTransform} = useMinimalShellMode() + const footerMinimalShellTransform = useMinimalShellFooterTransform() const {data: profile} = useProfileQuery({did: currentAccount?.did}) const {requestSwitchToAccount} = useLoggedOutViewControls() const closeAllActiveElements = useCloseAllActiveElements() diff --git a/src/view/shell/bottom-bar/BottomBarWeb.tsx b/src/view/shell/bottom-bar/BottomBarWeb.tsx index fcd4c86082..ff52af07bd 100644 --- a/src/view/shell/bottom-bar/BottomBarWeb.tsx +++ b/src/view/shell/bottom-bar/BottomBarWeb.tsx @@ -6,7 +6,7 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useNavigationState} from '@react-navigation/native' -import {useMinimalShellMode} from '#/lib/hooks/useMinimalShellMode' +import {useMinimalShellFooterTransform} from '#/lib/hooks/useMinimalShellTransform' import {usePalette} from '#/lib/hooks/usePalette' import {clamp} from '#/lib/numbers' import {getCurrentRoute, isTab} from '#/lib/routes/helpers' @@ -50,7 +50,7 @@ export function BottomBarWeb() { const pal = usePalette('default') const safeAreaInsets = useSafeAreaInsets() const gate = useGate() - const {footerMinimalShellTransform} = useMinimalShellMode() + const footerMinimalShellTransform = useMinimalShellFooterTransform() const {requestSwitchToAccount} = useLoggedOutViewControls() const closeAllActiveElements = useCloseAllActiveElements() const iconWidth = 26 From 620ab887132855d447f0a328bf58989c8f3f3328 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 10 Jun 2024 18:17:26 +0200 Subject: [PATCH 7/7] Ungate mobile web notification badge (#4459) --- src/lib/statsig/gates.ts | 1 - src/view/shell/bottom-bar/BottomBarWeb.tsx | 32 ++++++++++------------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/lib/statsig/gates.ts b/src/lib/statsig/gates.ts index 96be12c2d8..4481935f77 100644 --- a/src/lib/statsig/gates.ts +++ b/src/lib/statsig/gates.ts @@ -3,4 +3,3 @@ export type Gate = | 'request_notifications_permission_after_onboarding_v2' | 'show_avi_follow_button' | 'show_follow_back_label_v2' - | 'show_notification_badge_mobile_web' diff --git a/src/view/shell/bottom-bar/BottomBarWeb.tsx b/src/view/shell/bottom-bar/BottomBarWeb.tsx index ff52af07bd..21c253ee00 100644 --- a/src/view/shell/bottom-bar/BottomBarWeb.tsx +++ b/src/view/shell/bottom-bar/BottomBarWeb.tsx @@ -16,7 +16,6 @@ import {s} from '#/lib/styles' import {useSession} from '#/state/session' import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {useCloseAllActiveElements} from '#/state/util' -import {useGate} from 'lib/statsig/statsig' import {useUnreadMessageCount} from 'state/queries/messages/list-converations' import {useUnreadNotifications} from 'state/queries/notifications/unread' import {Button} from '#/view/com/util/forms/Button' @@ -49,7 +48,6 @@ export function BottomBarWeb() { const {hasSession, currentAccount} = useSession() const pal = usePalette('default') const safeAreaInsets = useSafeAreaInsets() - const gate = useGate() const footerMinimalShellTransform = useMinimalShellFooterTransform() const {requestSwitchToAccount} = useLoggedOutViewControls() const closeAllActiveElements = useCloseAllActiveElements() @@ -115,14 +113,13 @@ export function BottomBarWeb() { width={iconWidth - 1} style={[styles.ctrlIcon, pal.text, styles.messagesIcon]} /> - {unreadMessageCount.count > 0 && - gate('show_notification_badge_mobile_web') && ( - - - {unreadMessageCount.numUnread} - - - )} + {unreadMessageCount.count > 0 && ( + + + {unreadMessageCount.numUnread} + + + )} ) }} @@ -136,14 +133,13 @@ export function BottomBarWeb() { width={iconWidth} style={[styles.ctrlIcon, pal.text, styles.bellIcon]} /> - {notificationCountStr !== '' && - gate('show_notification_badge_mobile_web') && ( - - - {notificationCountStr} - - - )} + {notificationCountStr !== '' && ( + + + {notificationCountStr} + + + )} ) }}