Skip to content

Commit

Permalink
Merge pull request #2275 from daostack/cw-2239-allow-upto-7-pinned-items
Browse files Browse the repository at this point in the history
Increase allowed number of pinned items to 7 #2239
  • Loading branch information
andreymikhadyuk authored Oct 31, 2023
2 parents 8001285 + 84d5fa2 commit 1905140
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit 1905140

Please sign in to comment.