mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
perf(app): restore preloading channels and guilds on hover (#3208)
This commit is contained in:
1 parent
12a407aca8
commit
532e828fe6
7 files changed
+222
-13
No files matched your search
@@ -5,6 +5,7 @@ import {LongPressable} from '@app/features/app/components/LongPressable';
|
||||
import {getChannelUnreadState} from '@app/features/app/components/layout/utils/ChannelUnreadState';
|
||||
import {CustomStatusDisplay} from '@app/features/app/components/shared/custom_status_display/CustomStatusDisplay';
|
||||
import {GroupDMAvatar} from '@app/features/app/components/shared/GroupDMAvatar';
|
||||
import {useChannelHoverPreload} from '@app/features/app/hooks/useChannelHoverPreload';
|
||||
import {useContextMenuHoverState} from '@app/features/app/hooks/useContextMenuHoverState';
|
||||
import {UserTag} from '@app/features/channel/components/ChannelUserTag';
|
||||
import styles from '@app/features/channel/components/direct_message/DirectMessageList.module.css';
|
||||
@@ -198,9 +199,15 @@ const ResolvedDMListItem = observer(function ResolvedDMListItem({
|
||||
leaveGroup,
|
||||
i18n,
|
||||
});
|
||||
const {scheduleChannelPreload, cancelChannelPreload, preloadChannelNow} = useChannelHoverPreload({
|
||||
channel,
|
||||
guild: null,
|
||||
preloadMemberList: false,
|
||||
});
|
||||
const handleNavigate = useCallback(() => {
|
||||
preloadChannelNow();
|
||||
handlers.navigateTo();
|
||||
}, [handlers.navigateTo]);
|
||||
}, [handlers.navigateTo, preloadChannelNow]);
|
||||
const mobileMenuGroups = buildMobileMenuGroups({
|
||||
channel,
|
||||
recipient,
|
||||
@@ -500,6 +507,8 @@ const ResolvedDMListItem = observer(function ResolvedDMListItem({
|
||||
)}
|
||||
onClick={handleNavigate}
|
||||
onContextMenu={handleContextMenu}
|
||||
onMouseEnter={scheduleChannelPreload}
|
||||
onMouseLeave={cancelChannelPreload}
|
||||
onFocus={() => setIsFocused(true)}
|
||||
onBlur={() => setIsFocused(false)}
|
||||
data-dm-list-focus-item="true"
|
||||
|
||||
Reference in new issue
Block a user