Skip to content

Commit

Permalink
fix(hot): avoid image caching on profile
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Oct 1, 2024
1 parent 7c34c6c commit 3583f86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/(home)/(tabs)/my.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export default function My(): JSX.Element {
style={css`
opacity: ${user?.avatar_url ? '1' : '0.7'};
`}
source={user?.avatar_url ? {uri: user?.avatar_url} : IC_ICON}
source={
user?.avatar_url
? {uri: `${user?.avatar_url}?${new Date().toISOString()}`}
: IC_ICON
}
/>
<UserName>{user?.display_name || ''}</UserName>
{user?.affiliation ? (
Expand Down
6 changes: 3 additions & 3 deletions app/(home)/settings/profile-update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ export default function ProfileUpdate(): JSX.Element {
bucket: 'images',
destPath,
});

console.log('image', image);
}

const formDataWithTags = {
Expand Down Expand Up @@ -181,7 +179,9 @@ export default function ProfileUpdate(): JSX.Element {
);
setValue('future_expectations', user.profile.future_expectations || '');
setTags(user.userTags);
setProfileImg(`${user.profile.avatar_url}` || undefined);
setProfileImg(
`${user.profile.avatar_url}?${new Date().toISOString()}` || undefined,
);
}
}, [user, setValue]);

Expand Down

0 comments on commit 3583f86

Please sign in to comment.