Fix(frontend): SSRでユーザープロフィールが表示されない問題を修正
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
82c80a53a6
commit
50255432c4
2 changed files with 10 additions and 3 deletions
|
@ -638,7 +638,9 @@ export class ClientServerService {
|
|||
reply.header('X-Robots-Tag', 'noai');
|
||||
}
|
||||
|
||||
const _user = await this.userEntityService.pack(user);
|
||||
const _user = await this.userEntityService.pack(user, null, {
|
||||
schema: host ? 'UserLite' : 'UserDetailedNotMe' // リモートユーザーの場合は詳細情報を返さない
|
||||
});
|
||||
|
||||
return await reply.view('user', {
|
||||
user, profile, me,
|
||||
|
@ -712,9 +714,14 @@ export class ClientServerService {
|
|||
// Page
|
||||
fastify.get<{ Params: { user: string; page: string; } }>('/@:user/pages/:page', async (request, reply) => {
|
||||
const { username, host } = Acct.parse(request.params.user);
|
||||
|
||||
if (host) {
|
||||
return await renderBase(reply); // リモートユーザーのページはSSRしない
|
||||
}
|
||||
|
||||
const user = await this.usersRepository.findOneBy({
|
||||
usernameLower: username.toLowerCase(),
|
||||
host: host ?? IsNull(),
|
||||
host: IsNull(),
|
||||
});
|
||||
|
||||
if (user == null) return;
|
||||
|
|
|
@ -53,7 +53,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div><MkSparkle><Mfm :plain="true" :text="user.followedMessage" :author="user"/></MkSparkle></div>
|
||||
</MkFukidashi>
|
||||
</div>
|
||||
<div v-if="user.roles.length > 0" class="roles">
|
||||
<div v-if="user.roles && user.roles.length > 0" class="roles">
|
||||
<span v-for="role in user.roles" :key="role.id" v-tooltip="role.description" class="role" :style="{ '--color': role.color }">
|
||||
<MkA v-adaptive-bg :to="`/roles/${role.id}`">
|
||||
<img v-if="role.iconUrl" style="height: 1.3em; vertical-align: -22%;" :src="role.iconUrl"/>
|
||||
|
|
Loading…
Add table
Reference in a new issue