From 84d5fa27bb5d9c5e0376d4874ca87d704835d992 Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Mon, 30 Oct 2023 18:46:58 -0400 Subject: [PATCH] allow up to 7 pinned items --- .../DiscussionFeedCard/utils/checkIsPinUnpinAllowed.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/common/components/DiscussionFeedCard/utils/checkIsPinUnpinAllowed.ts b/src/pages/common/components/DiscussionFeedCard/utils/checkIsPinUnpinAllowed.ts index d8b4efc8fc..10121f1ade 100644 --- a/src/pages/common/components/DiscussionFeedCard/utils/checkIsPinUnpinAllowed.ts +++ b/src/pages/common/components/DiscussionFeedCard/utils/checkIsPinUnpinAllowed.ts @@ -3,6 +3,8 @@ import { PredefinedTypes } from "@/shared/models"; import { hasPermission } from "@/shared/utils"; import { FeedItemPinAction, GetAllowedItemsOptions } from "../../FeedItem"; +const PINNED_ITEMS_LIMIT = 7; + export function checkIsPinUnpinAllowed( action: FeedItemPinAction, options: GetAllowedItemsOptions, @@ -17,7 +19,7 @@ export function checkIsPinUnpinAllowed( } if (action === FeedItemPinAction.Pin) { - const hasReachedPinLimit = pinnedFeedItems.length >= 3; + const hasReachedPinLimit = pinnedFeedItems.length >= PINNED_ITEMS_LIMIT; if (isDiscussionPinned || hasReachedPinLimit) { return false;