summaryrefslogtreecommitdiff
path: root/src/services/note/unread.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-03-21 21:27:09 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-03-21 21:27:09 +0900
commitc4c20bee7c58ea7330dbc890b9564bd100ac6e25 (patch)
tree2f73ce46b5f0abe1417dad110ffc23c53155a8fe /src/services/note/unread.ts
parentrefactor: Use Set (diff)
downloadsharkey-c4c20bee7c58ea7330dbc890b9564bd100ac6e25.tar.gz
sharkey-c4c20bee7c58ea7330dbc890b9564bd100ac6e25.tar.bz2
sharkey-c4c20bee7c58ea7330dbc890b9564bd100ac6e25.zip
wip #6441
Diffstat (limited to 'src/services/note/unread.ts')
-rw-r--r--src/services/note/unread.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/services/note/unread.ts b/src/services/note/unread.ts
index 6fd9ee2cfe..8e6fb4abe8 100644
--- a/src/services/note/unread.ts
+++ b/src/services/note/unread.ts
@@ -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 () => {