From 6b700b152ccafff80fb2bcafbc9e3b9c49a5151d Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Sun, 15 Jan 2023 02:24:56 +0100 Subject: [PATCH] fix: deliver queue --- packages/backend/src/services/note/create.ts | 13 ++++++------- packages/client/src/components/MkPagination.vue | 8 ++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 5bba98f85..210ea7771 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -252,13 +252,12 @@ export default async ( let mentionedUsers = data.apMentions; // Parse MFM if needed - if (!((tags && emojis ) && mentionedUsers)) { + if (!(tags && emojis && mentionedUsers)) { const tokens = data.text ? mfm.parse(data.text)! : []; const cwTokens = data.cw ? mfm.parse(data.cw)! : []; - const choiceTokens = - data.poll?.choices - ? concat(data.poll.choices.map((choice) => mfm.parse(choice)!)) - : []; + const choiceTokens = data.poll?.choices + ? concat(data.poll.choices.map((choice) => mfm.parse(choice)!)) + : []; const combinedTokens = tokens.concat(cwTokens).concat(choiceTokens); @@ -534,13 +533,13 @@ export default async ( } // 投稿がリプライかつ投稿者がローカルユーザーかつリプライ先の投稿の投稿者がリモートユーザーなら配送 - if (data.reply?.userHost !== null) { + if (data.reply && data.reply.userHost !== null) { const u = await Users.findOneBy({ id: data.reply.userId }); if (u && Users.isRemoteUser(u)) dm.addDirectRecipe(u); } // 投稿がRenoteかつ投稿者がローカルユーザーかつRenote元の投稿の投稿者がリモートユーザーなら配送 - if (data.renote?.userHost !== null) { + if (data.renote && data.renote.userHost !== null) { const u = await Users.findOneBy({ id: data.renote.userId }); if (u && Users.isRemoteUser(u)) dm.addDirectRecipe(u); } diff --git a/packages/client/src/components/MkPagination.vue b/packages/client/src/components/MkPagination.vue index 01f4a94d4..95ea9f8f3 100644 --- a/packages/client/src/components/MkPagination.vue +++ b/packages/client/src/components/MkPagination.vue @@ -33,17 +33,17 @@