refactor(app): drop the unread jump anchor now the scroller finds it (#1858)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-24 12:32:44 +02:00
1 parent af7469fa1f
commit 52781cfa2d
17 files changed
+148 -152

No files matched your search

@@ -4,7 +4,6 @@ import type {Channel} from '@app/features/channel/models/Channel';
import type {Guild} from '@app/features/guild/models/Guild';
import {ensureMembersForMessages} from '@app/features/messaging/commands/MessageCommands';
import Messages from '@app/features/messaging/state/MessagingMessages';
import ReadStates from '@app/features/read_state/state/ReadStates';
import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
import {useCallback, useEffect, useRef} from 'react';
@@ -57,8 +56,7 @@ export function useChannelHoverPreload({
return;
}
if (preloadMessages) {
const unreadAnchor = ReadStates.getUnreadJumpAnchor(channel.id);
if (!Messages.preloadLatestPage(channel.id, guild?.id ?? channel.guildId ?? null, unreadAnchor)) {
if (!Messages.preloadLatestPage(channel.id, guild?.id ?? channel.guildId ?? null)) {
ensureMembersForCachedChannelMessages(channel.id);
}
}
@@ -349,7 +349,7 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): v
if (type !== 'press') return;
const inboxTab = Inbox.selectedTab;
if (inboxTab === 'unreadChannels') {
const unreadChannelId = ReadStates.getChannelIds().find((channelId) => ReadStates.hasUnreadOrMentions(channelId));
const unreadChannelId = ReadStates.getChannelIds().find((channelId) => ReadStates.isUnreadOrMentioned(channelId));
if (unreadChannelId) {
ReadStateCommands.ack(unreadChannelId, true, true);
}