Resolve #7538
This commit is contained in:
parent
30d2a1d8b6
commit
0eb115bf7e
|
@ -5,6 +5,7 @@ import define from '../../define';
|
||||||
import { makePaginationQuery } from '../../common/make-pagination-query';
|
import { makePaginationQuery } from '../../common/make-pagination-query';
|
||||||
import { Notifications, Followings, Mutings, Users } from '../../../../models';
|
import { Notifications, Followings, Mutings, Users } from '../../../../models';
|
||||||
import { notificationTypes } from '../../../../types';
|
import { notificationTypes } from '../../../../types';
|
||||||
|
import read from '@/services/note/read';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
desc: {
|
desc: {
|
||||||
|
@ -116,5 +117,11 @@ export default define(meta, async (ps, user) => {
|
||||||
readNotification(user.id, notifications.map(x => x.id));
|
readNotification(user.id, notifications.map(x => x.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const notes = notifications.filter(notification => ['mention', 'reply', 'quote'].includes(notification.type)).map(notification => notification.note!);
|
||||||
|
|
||||||
|
if (notes.length > 0) {
|
||||||
|
read(user.id, notes);
|
||||||
|
}
|
||||||
|
|
||||||
return await Notifications.packMany(notifications, user.id);
|
return await Notifications.packMany(notifications, user.id);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue