mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-11 17:50:29 +03:00
Use Tanstack Query when fetching extended profiles to improve caching
This commit is contained in:
parent
c389365ea2
commit
07df0c2c79
3 changed files with 18 additions and 22 deletions
|
|
@ -23,7 +23,6 @@ import { CreatorChip } from './CreatorChip';
|
|||
import { getDirectCreatePath, withSearchParam } from '../../pages/pathUtils';
|
||||
import { DirectCreateSearchParams } from '../../pages/paths';
|
||||
import { useExtendedProfile } from '../../hooks/useExtendedProfile';
|
||||
import { AsyncStatus } from '../../hooks/useAsyncCallback';
|
||||
|
||||
type UserRoomProfileProps = {
|
||||
userId: string;
|
||||
|
|
@ -58,8 +57,7 @@ export function UserRoomProfile({ userId }: UserRoomProfileProps) {
|
|||
const displayName = getMemberDisplayName(room, userId);
|
||||
const avatarMxc = getMemberAvatarMxc(room, userId);
|
||||
const avatarUrl = (avatarMxc && mxcUrlToHttp(mx, avatarMxc, useAuthentication)) ?? undefined;
|
||||
const [extendedProfileState, refreshExtendedProfile] = useExtendedProfile(userId);
|
||||
const extendedProfile = extendedProfileState.status === AsyncStatus.Success ? extendedProfileState.data : undefined;
|
||||
const [extendedProfile, refreshExtendedProfile] = useExtendedProfile(userId);
|
||||
const timezone = useMemo(() => {
|
||||
// @ts-expect-error Intl.supportedValuesOf isn't in the types yet
|
||||
const supportedTimezones = Intl.supportedValuesOf('timeZone') as string[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue