This commit is contained in:
syuilo 2021-03-21 21:27:09 +09:00
parent 41b491fa7c
commit c4c20bee7c
28 changed files with 44 additions and 40 deletions

View file

@ -17,7 +17,7 @@ export default async function(userId: User['id'], note: Note, params: {
if (mute.map(m => m.muteeId).includes(note.userId)) return;
//#endregion
const unread = await NoteUnreads.save({
const unread = {
id: genId(),
noteId: note.id,
userId: userId,
@ -25,7 +25,9 @@ export default async function(userId: User['id'], note: Note, params: {
isMentioned: params.isMentioned,
noteChannelId: note.channelId,
noteUserId: note.userId,
});
};
await NoteUnreads.insert(unread);
// 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する
setTimeout(async () => {