From 8a97bd63c71d36d2c9e5a44a8a199cc4ef3b3f57 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Wed, 19 Dec 2018 10:23:57 +0900 Subject: [PATCH] Refactor --- src/server/api/stream/channels/hashtag.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/api/stream/channels/hashtag.ts b/src/server/api/stream/channels/hashtag.ts index 052240c18..c8b6c578d 100644 --- a/src/server/api/stream/channels/hashtag.ts +++ b/src/server/api/stream/channels/hashtag.ts @@ -20,7 +20,8 @@ export default class extends Channel { // Subscribe stream this.subscriber.on('hashtag', async note => { - const matched = q.some(tags => tags.every(tag => note.tags.map((t: string) => t.toLowerCase()).includes(tag.toLowerCase()))); + const noteTags = note.tags.map((t: string) => t.toLowerCase()); + const matched = q.some(tags => tags.every(tag => noteTags.includes(tag.toLowerCase()))); if (!matched) return; // Renoteなら再pack