From 556677be7ae4e1075f4170dc5b92ed485f2889da 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 052240c18c..c8b6c578de 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