From 8b55fc7917929a3812fc820975632a26af3cabeb Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 21:45:09 +0200 Subject: [PATCH] upd: change handling of masto needed desc --- packages/backend/src/core/entities/UserEntityService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 297617283..a339194cc 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -321,7 +321,7 @@ export class UserEntityService implements OnModuleInit { .getMany() : []; const profile = opts.detail ? (opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id })) : null; - const mastoapi = opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); + const mastoapi = !opts.detail ? opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id }) : null; const followingCount = profile == null ? null : (profile.ffVisibility === 'public') || isMe ? user.followingCount : @@ -346,7 +346,7 @@ export class UserEntityService implements OnModuleInit { host: user.host, avatarUrl: user.avatarUrl ?? this.getIdenticonUrl(user), avatarBlurhash: user.avatarBlurhash, - description: mastoapi!.description, + description: mastoapi ? mastoapi.description : profile ? profile.description : '', createdAt: user.createdAt.toISOString(), isBot: user.isBot ?? falsy, isCat: user.isCat ?? falsy,