From 39bdfb6e0d3270b37c614bc0d54749faeb6c0623 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 8 Oct 2018 02:10:46 +0900 Subject: [PATCH] Improve usability --- src/notify.ts | 4 ++-- src/server/api/endpoints/messaging/messages/create.ts | 4 ++-- src/services/note/unread.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/notify.ts b/src/notify.ts index eaef63e3c..522f4c52d 100644 --- a/src/notify.ts +++ b/src/notify.ts @@ -39,7 +39,7 @@ export default ( } }); - // 3秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する + // 2秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する setTimeout(async () => { const fresh = await Notification.findOne({ _id: notification._id }, { isRead: true }); if (!fresh.isRead) { @@ -58,5 +58,5 @@ export default ( pushSw(notifiee, 'notification', packed); } - }, 3000); + }, 2000); }); diff --git a/src/server/api/endpoints/messaging/messages/create.ts b/src/server/api/endpoints/messaging/messages/create.ts index f504f9232..cb115cf98 100644 --- a/src/server/api/endpoints/messaging/messages/create.ts +++ b/src/server/api/endpoints/messaging/messages/create.ts @@ -102,7 +102,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = } }); - // 3秒経っても(今回作成した)メッセージが既読にならなかったら「未読のメッセージがありますよ」イベントを発行する + // 2秒経っても(今回作成した)メッセージが既読にならなかったら「未読のメッセージがありますよ」イベントを発行する setTimeout(async () => { const freshMessage = await Message.findOne({ _id: message._id }, { isRead: true }); if (!freshMessage.isRead) { @@ -120,7 +120,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = publishMainStream(message.recipientId, 'unreadMessagingMessage', messageObj); pushSw(message.recipientId, 'unreadMessagingMessage', messageObj); } - }, 3000); + }, 2000); // 履歴作成(自分) History.update({ diff --git a/src/services/note/unread.ts b/src/services/note/unread.ts index 5953f61fe..e84ac2a4b 100644 --- a/src/services/note/unread.ts +++ b/src/services/note/unread.ts @@ -22,7 +22,7 @@ export default async function(user: IUser, note: INote, isSpecified = false) { } }); - // 3秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する + // 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する setTimeout(async () => { const exist = await NoteUnread.findOne({ _id: unread._id }); if (exist == null) return; @@ -43,5 +43,5 @@ export default async function(user: IUser, note: INote, isSpecified = false) { if (isSpecified) { publishMainStream(user._id, 'unreadSpecifiedNote', note._id); } - }, 3000); + }, 2000); }