From 31c53d2dff70f8008d0526edab08f4f92371ce58 Mon Sep 17 00:00:00 2001 From: Hampus Date: Tue, 22 Sep 2026 02:00:26 +0200 Subject: [PATCH] fix(app): stop pending stickers from reloading the channel (#2890) --- .../channel/components/ChannelStickersArea.tsx | 11 ----------- .../components/LexicalChannelTextareaContent.tsx | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx b/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx index 92a7f22c4..b35c9655b 100644 --- a/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx +++ b/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx @@ -4,7 +4,6 @@ import * as ChannelStickerCommands from '@app/features/channel/commands/ChannelS import styles from '@app/features/channel/components/ChannelStickersArea.module.css'; import ChannelSticker from '@app/features/channel/state/ChannelSticker'; import {useStickerAnimation} from '@app/features/emoji/hooks/useStickerAnimation'; -import {ComponentBus} from '@app/features/platform/utils/ComponentBus'; import {StickerContextMenuItems} from '@app/features/ui/action_menu/items/StickerContextMenuItems'; import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands'; import FocusRing from '@app/features/ui/focus_ring/FocusRing'; @@ -16,7 +15,6 @@ import {TrashIcon} from '@phosphor-icons/react'; import {clsx} from 'clsx'; import {observer} from 'mobx-react-lite'; import type React from 'react'; -import {useEffect, useState} from 'react'; const REMOVE_STICKER_DESCRIPTOR = msg({ message: 'Remove sticker', @@ -33,15 +31,6 @@ export const ChannelStickersArea: React.FC = observer( const {i18n} = useLingui(); const sticker = ChannelSticker.getPendingSticker(channelId); const {shouldAnimate, interactionHandlers} = useStickerAnimation({isAnimated: sticker?.animated ?? false}); - const [previousSticker, setPreviousSticker] = useState(sticker); - useEffect(() => { - if (previousSticker && !sticker) { - ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT'); - } else if (!previousSticker && sticker) { - ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT'); - } - setPreviousSticker(sticker); - }, [sticker, previousSticker]); if (!sticker) { return null; } diff --git a/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx b/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx index ca1d2c788..92b25ceb6 100644 --- a/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx +++ b/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx @@ -707,7 +707,8 @@ export const LexicalChannelTextareaContent = observer( const stickerBoundaryChanged = isSameChannel && previous.hasPendingSticker !== hasPendingSticker; if ( wasAtBottomBeforeComposerBoundaryChange.current && - (stickerBoundaryChanged || (attachmentBoundaryChanged && Messages.getMessages(channel.id).hasMoreAfter)) + (stickerBoundaryChanged || attachmentBoundaryChanged) && + Messages.getMessages(channel.id).hasMoreAfter ) { ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT', {channelId: channel.id}); }