From 5eb02b49017ab6cc38d18d6f0a3d7fd8acf29e58 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 12 Mar 2019 09:50:20 +0900 Subject: [PATCH] Resolve #4458 (#4476) --- src/server/api/endpoints/notes/polls/recommendation.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/api/endpoints/notes/polls/recommendation.ts b/src/server/api/endpoints/notes/polls/recommendation.ts index 0a05e89c6..9adabdf0e 100644 --- a/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/src/server/api/endpoints/notes/polls/recommendation.ts @@ -52,10 +52,18 @@ export default define(meta, async (ps, user) => { $ne: user._id, $nin: hideUserIds }, + visibility: 'public', poll: { $exists: true, $ne: null - } + }, + $or: [{ + 'poll.expiresAt': null + }, { + 'poll.expiresAt': { + $gt: new Date() + } + }], }, { limit: ps.limit, skip: ps.offset,