fix: notifierIdがない通知が消えてしまう問題 (grouped)

This commit is contained in:
taichan 2024-02-20 01:30:14 +09:00
parent 094e10a278
commit c21b6d95ae
No known key found for this signature in database
GPG Key ID: CCE28623AFA24E9C

View File

@ -6,6 +6,7 @@
import { Brackets, In } from 'typeorm';
import * as Redis from 'ioredis';
import { Inject, Injectable } from '@nestjs/common';
import { not } from 'ajv/dist/compile/codegen/index.js';
import type { NotesRepository, UsersRepository } from '@/models/_.js';
import { obsoleteNotificationTypes, notificationTypes, FilterUnionByProperty } from '@/types.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
@ -121,7 +122,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
]);
notifications = (await Promise.all(notifications.map(async (notification): Promise<MiNotification|null> => {
if (!('notifierId' in notification)) return null;
if (!('notifierId' in notification)) return notification;
if (userIdsWhoMeMuting.has(notification.notifierId)) return null;
const notifier = await this.usersRepository.findOneBy({ id: notification.notifierId });