refactor: resolve #7139
This commit is contained in:
@@ -9,7 +9,6 @@ import renderEmoji from './emoji';
|
||||
import { IIdentifier } from '../models/identifier';
|
||||
import renderHashtag from './hashtag';
|
||||
import { DriveFiles, UserProfiles, UserKeypairs } from '../../../models';
|
||||
import { ensure } from '../../../prelude/ensure';
|
||||
|
||||
export async function renderPerson(user: ILocalUser) {
|
||||
const id = `${config.url}/users/${user.id}`;
|
||||
@@ -18,7 +17,7 @@ export async function renderPerson(user: ILocalUser) {
|
||||
const [avatar, banner, profile] = await Promise.all([
|
||||
user.avatarId ? DriveFiles.findOne(user.avatarId) : Promise.resolve(undefined),
|
||||
user.bannerId ? DriveFiles.findOne(user.bannerId) : Promise.resolve(undefined),
|
||||
UserProfiles.findOne(user.id).then(ensure)
|
||||
UserProfiles.findOneOrFail(user.id)
|
||||
]);
|
||||
|
||||
const attachment: {
|
||||
@@ -50,7 +49,7 @@ export async function renderPerson(user: ILocalUser) {
|
||||
...hashtagTags,
|
||||
];
|
||||
|
||||
const keypair = await UserKeypairs.findOne(user.id).then(ensure);
|
||||
const keypair = await UserKeypairs.findOneOrFail(user.id);
|
||||
|
||||
const person = {
|
||||
type: isSystem ? 'Application' : user.isBot ? 'Service' : 'Person',
|
||||
|
Reference in New Issue
Block a user