Improve usability

This commit is contained in:
syuilo 2018-10-08 02:10:46 +09:00
parent 1003fd393e
commit 39bdfb6e0d
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
3 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ export default (
} }
}); });
// 3秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する // 2秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する
setTimeout(async () => { setTimeout(async () => {
const fresh = await Notification.findOne({ _id: notification._id }, { isRead: true }); const fresh = await Notification.findOne({ _id: notification._id }, { isRead: true });
if (!fresh.isRead) { if (!fresh.isRead) {
@ -58,5 +58,5 @@ export default (
pushSw(notifiee, 'notification', packed); pushSw(notifiee, 'notification', packed);
} }
}, 3000); }, 2000);
}); });

View File

@ -102,7 +102,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
} }
}); });
// 3秒経っても(今回作成した)メッセージが既読にならなかったら「未読のメッセージがありますよ」イベントを発行する // 2秒経っても(今回作成した)メッセージが既読にならなかったら「未読のメッセージがありますよ」イベントを発行する
setTimeout(async () => { setTimeout(async () => {
const freshMessage = await Message.findOne({ _id: message._id }, { isRead: true }); const freshMessage = await Message.findOne({ _id: message._id }, { isRead: true });
if (!freshMessage.isRead) { if (!freshMessage.isRead) {
@ -120,7 +120,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
publishMainStream(message.recipientId, 'unreadMessagingMessage', messageObj); publishMainStream(message.recipientId, 'unreadMessagingMessage', messageObj);
pushSw(message.recipientId, 'unreadMessagingMessage', messageObj); pushSw(message.recipientId, 'unreadMessagingMessage', messageObj);
} }
}, 3000); }, 2000);
// 履歴作成(自分) // 履歴作成(自分)
History.update({ History.update({

View File

@ -22,7 +22,7 @@ export default async function(user: IUser, note: INote, isSpecified = false) {
} }
}); });
// 3秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する // 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する
setTimeout(async () => { setTimeout(async () => {
const exist = await NoteUnread.findOne({ _id: unread._id }); const exist = await NoteUnread.findOne({ _id: unread._id });
if (exist == null) return; if (exist == null) return;
@ -43,5 +43,5 @@ export default async function(user: IUser, note: INote, isSpecified = false) {
if (isSpecified) { if (isSpecified) {
publishMainStream(user._id, 'unreadSpecifiedNote', note._id); publishMainStream(user._id, 'unreadSpecifiedNote', note._id);
} }
}, 3000); }, 2000);
} }