mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix(app): resolve the unread anchor where channel message loads originate (#1701)
This commit is contained in:
1 parent
97c29bf1fb
commit
c35d29ea0b
3 files changed
+37
-8
No files matched your search
@@ -4,6 +4,7 @@ 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';
|
||||
|
||||
@@ -56,7 +57,8 @@ export function useChannelHoverPreload({
|
||||
return;
|
||||
}
|
||||
if (preloadMessages) {
|
||||
if (!Messages.preloadLatestPage(channel.id, guild?.id ?? channel.guildId ?? null)) {
|
||||
const unreadAnchor = ReadStates.getUnreadJumpAnchor(channel.id);
|
||||
if (!Messages.preloadLatestPage(channel.id, guild?.id ?? channel.guildId ?? null, unreadAnchor)) {
|
||||
ensureMembersForCachedChannelMessages(channel.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user