Skip to content

Commit

Permalink
Check if post was already pinned/unpinned
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Damer committed Jun 1, 2023
1 parent e7eca9b commit b02d486
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/superclasses/Posts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ contract Posts is KetlGuarded {
onlyElevatedPriveleges(feedId, sender)
{
require(postId < lastPostIds[feedId].current(), "Post not found");
require(pinnedPosts[feedId][postId] != pin, "Post already pinned/unpinned");
pinnedPosts[feedId][postId] = pin;
if (pin) {
emit PostPinned(feedId, postId);
Expand Down

0 comments on commit b02d486

Please sign in to comment.