From 8d41b85780cc492a35782379f379901c4816efb3 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 8 Aug 2023 17:22:08 +0900 Subject: [PATCH] fix: accept 15 featured posts (close #61) --- README.md | 2 ++ packages/backend/src/remote/activitypub/models/person.ts | 2 +- packages/backend/src/services/i/pin.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd83be7af..a57f5a4e7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ ## 細かい変更点 +- 最大 15 件の投稿を固定できるように + - 5 件は少ないと思ったため - 投稿ボタンを巨大にできるように - https://mstdn.poyo.me/@prime/110668364208741253 を真似しました - アンテナにフォロー中のユーザーのホーム投稿も表示する diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 8f17cfae8..6987798ff 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -671,7 +671,7 @@ export async function updateFeatured(userId: User["id"], resolver?: Resolver) { const featuredNotes = await Promise.all( items .filter((item) => getApType(item) === "Note") // TODO: Maybe it doesn't have to be a Note. - .slice(0, 5) + .slice(0, 15) .map((item) => limit(() => resolveNote(item, resolver))), ); diff --git a/packages/backend/src/services/i/pin.ts b/packages/backend/src/services/i/pin.ts index 97045a9fa..64b9b159f 100644 --- a/packages/backend/src/services/i/pin.ts +++ b/packages/backend/src/services/i/pin.ts @@ -35,7 +35,7 @@ export async function addPinned( const pinings = await UserNotePinings.findBy({ userId: user.id }); - if (pinings.length >= 5) { + if (pinings.length >= 15) { throw new IdentifiableError( "15a018eb-58e5-4da1-93be-330fcc5e4e1a", "You can not pin notes any more.",