mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-01 15:39:03 +02:00
Adjust permissions for unclaimed participants
This commit is contained in:
parent
5c991d7011
commit
ccc2896b2d
3 changed files with 31 additions and 24 deletions
|
@ -13,7 +13,6 @@ import {
|
|||
CreateCommentPayload,
|
||||
} from "../../api-client/create-comment";
|
||||
import { requiredString } from "../../utils/form-validation";
|
||||
import Badge from "../badge";
|
||||
import Button from "../button";
|
||||
import CompactButton from "../compact-button";
|
||||
import Dropdown, { DropdownItem } from "../dropdown";
|
||||
|
@ -24,7 +23,7 @@ import TruncatedLinkify from "../poll/truncated-linkify";
|
|||
import UserAvatar from "../poll/user-avatar";
|
||||
import { usePoll } from "../poll-context";
|
||||
import { usePreferences } from "../preferences/use-preferences";
|
||||
import { useSession } from "../session";
|
||||
import { isUnclaimed, useSession } from "../session";
|
||||
|
||||
export interface DiscussionProps {
|
||||
pollId: string;
|
||||
|
@ -125,7 +124,9 @@ const Discussion: React.VoidFunctionComponent<DiscussionProps> = ({
|
|||
<AnimatePresence initial={false}>
|
||||
{comments.map((comment) => {
|
||||
const canDelete =
|
||||
poll.role === "admin" || session.ownsObject(comment);
|
||||
poll.role === "admin" ||
|
||||
session.ownsObject(comment) ||
|
||||
isUnclaimed(comment);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue