Skip to content

Commit

Permalink
remove proposal state check to display Remove option
Browse files Browse the repository at this point in the history
  • Loading branch information
andreymikhadyuk committed Sep 27, 2023
1 parent ecbf87b commit 8228f8d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GovernanceActions } from "@/shared/constants";
import { PredefinedTypes } from "@/shared/models";
import { checkIsCountdownState, hasPermission } from "@/shared/utils";
import { hasPermission } from "@/shared/utils";
import { GetAllowedItemsOptions } from "../../FeedItem";

export function checkIsRemoveDiscussionAllowed(
Expand All @@ -27,17 +27,11 @@ export function checkIsRemoveDiscussionAllowed(
return hasPermissionToRemoveDiscussion;
}

const { proposalState } = options;
const hasPermissionToRemoveProposal =
return (
hasPermission({
commonMember: options.commonMember,
governance: { circles },
key: GovernanceActions.HIDE_OR_UNHIDE_PROPOSAL,
}) || isDiscussionOwner;

return Boolean(
proposalState &&
checkIsCountdownState({ state: proposalState }) &&
hasPermissionToRemoveProposal,
}) || isDiscussionOwner
);
}
2 changes: 0 additions & 2 deletions src/pages/common/components/FeedItem/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Discussion,
CommonFeedType,
CommonFeedObjectUserUnique,
ProposalState,
} from "@/shared/models";
import { FeedItemMenuItem } from "./constants";

Expand All @@ -22,7 +21,6 @@ export interface GetAllowedItemsOptions {
discussion?: Discussion | null;
governanceCircles?: Circles;
feedItem?: CommonFeed;
proposalState?: ProposalState;
commonMember?: CommonMember | null;
feedItemFollow: FeedItemFollowState;
getNonAllowedItems?: GetNonAllowedItemsOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ const ProposalFeedCard = forwardRef<FeedItemRef, ProposalFeedCardProps>(
feedItem: item,
discussion,
governanceCircles,
proposalState: proposal?.state,
commonMember,
feedItemFollow,
getNonAllowedItems,
Expand Down

0 comments on commit 8228f8d

Please sign in to comment.