Skip to content

Conversation

@miya
Copy link
Member

@miya miya commented Nov 21, 2025

@miya miya requested a review from yuki-takei November 21, 2025 09:29
@miya miya self-assigned this Nov 21, 2025
select: 'filePathProxied',
});
currentUser = userData.toObject();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考

getServerSideProps で imageAttachment.filePathProxied を populate している例 (master のコード)

if (user != null) {
const User = crowi.model('User');
const userData = await User.findById(user.id).populate({
path: 'imageAttachment',
select: 'filePathProxied',
});
props.currentUser = userData.toObject();
}

/me でアップロードされた画像の URL を取得するロジック (master と同じ)

const [isGravatarEnabled, setGravatarEnabled] = useState(currentUser?.isGravatarEnabled);
const [uploadedPictureSrc, setUploadedPictureSrc] = useState(() => {
if (currentUser?.imageAttachment != null && isPopulated(currentUser.imageAttachment)) {
return currentUser.imageAttachment.filePathProxied ?? currentUser.image;
}
return currentUser?.image;
});

@yuki-takei yuki-takei merged commit 9cbee49 into dev/7.4.x Nov 21, 2025
16 checks passed
@yuki-takei yuki-takei deleted the fix/174425-profile-image-uploaded-in-user-settings-is-not-displayed branch November 21, 2025 12:28
@github-actions github-actions bot mentioned this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants