minor improvements

This commit is contained in:
naskya 2024-06-29 18:40:59 +09:00
parent 1aaa976da2
commit eb6c30301b
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -534,7 +534,7 @@ export class NoteHelpers {
expiresAt: expiresAt:
request.poll.expires_in && request.poll.expires_in > 0 request.poll.expires_in && request.poll.expires_in > 0
? new Date( ? new Date(
new Date().getTime() + request.poll.expires_in * 1000, Date.now() + request.poll.expires_in * 1000,
) )
: null, : null,
} }
@ -642,7 +642,7 @@ export class NoteHelpers {
const note = await getNote(noteId, ctx.user); const note = await getNote(noteId, ctx.user);
const conversationId = note.threadId ?? note.id; const conversationId = note.threadId ?? note.id;
const userIds = unique( const userIds = unique(
[note.userId].concat(note.visibleUserIds).filter((p) => p != ctx.user.id), [note.userId].concat(note.visibleUserIds).filter((p) => p !== ctx.user.id),
); );
const users = userIds.map((id) => const users = userIds.map((id) =>
UserHelpers.getUserCached(id, ctx).catch((_) => null), UserHelpers.getUserCached(id, ctx).catch((_) => null),