Skip to content

Commit

Permalink
update easy comments
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Damer committed Jun 5, 2023
1 parent a888e7f commit 590dd00
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contracts/superclasses/Posts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ pragma solidity ^0.8.19;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../models/PostAndParticipants.sol";
import "../models/Reaction.sol";
import "../models/PostRequest.sol";
Expand Down Expand Up @@ -332,7 +331,7 @@ contract Posts is KetlGuarded {
// Fetch post or comment
Post memory post = commentId == 0
? posts[feedId][postId]
: comments[feedId][postId][commentId - 1]; // -1 because commentIds starts with 1
: comments[feedId][postId][commentId - 1]; // comments start with 1
// Check if post or comment exists
require(post.author != address(0), "Post or comment not found");
// Get old reaction if it exists
Expand Down Expand Up @@ -400,7 +399,7 @@ contract Posts is KetlGuarded {
// Fetch post or comment
Post memory post = commentId == 0
? posts[feedId][postId]
: comments[feedId][postId][commentId - 1]; // -1 because commentIds starts with 1
: comments[feedId][postId][commentId - 1]; // comments start with 1
// Check if post or comment exists
require(post.author != address(0), "Post or comment not found");
// Check if sent by the owner
Expand All @@ -423,7 +422,7 @@ contract Posts is KetlGuarded {
// Fetch post or comment
Post memory post = commentId == 0
? posts[feedId][postId]
: comments[feedId][postId][commentId - 1]; // -1 because commentIds starts with 1
: comments[feedId][postId][commentId - 1]; // comments start with 1
// Check if post or comment exists
require(post.author != address(0), "Post or comment not found");
// Get the number of reactions
Expand Down

0 comments on commit 590dd00

Please sign in to comment.