refactor: resolve #7139

This commit is contained in:
syuilo
2021-02-13 15:33:38 +09:00
parent ebadd7fd3f
commit 91172654e4
76 changed files with 107 additions and 221 deletions

View File

@@ -3,7 +3,6 @@ import { Note } from '../../../models/entities/note';
import { User } from '../../../models/entities/user';
import { Notes, UserProfiles, NoteReactions } from '../../../models';
import { generateMutedUserQuery } from './generate-muted-user-query';
import { ensure } from '../../../prelude/ensure';
// TODO: リアクション、Renote、返信などをしたートは除外する
@@ -11,7 +10,7 @@ export async function injectFeatured(timeline: Note[], user?: User | null) {
if (timeline.length < 5) return;
if (user) {
const profile = await UserProfiles.findOne(user.id).then(ensure);
const profile = await UserProfiles.findOneOrFail(user.id);
if (!profile.injectFeaturedNote) return;
}