Error loading comments: {error.message}
; // Join the comments with the pending comments but append the pending comments at the beginning of the list - const commentsWithPending = pendingComments[id] ? [...pendingComments[id], ...(comments ?? [])] : comments; + const commentsWithPending = pendingComments[id] + ? [...pendingComments[id], ...(comments ?? [])] + : comments; const commentsFiltered = (commentsWithPending ?? []) - .filter((comment) => !hiddenComments.some((hiddenComment: any) => hiddenComment.id === comment.id)) - .filter((comment) => !comment.isHidden) + .filter( + (comment) => !hiddenComments.some((hiddenComment: any) => hiddenComment.id === comment.id) + ) + .filter((comment) => !comment.isHidden); return ( <> diff --git a/src/sections/publication/publication-details-comment-form.tsx b/src/sections/publication/publication-details-comment-form.tsx index 40cb8f145..fc2cfffde 100644 --- a/src/sections/publication/publication-details-comment-form.tsx +++ b/src/sections/publication/publication-details-comment-form.tsx @@ -21,10 +21,10 @@ import Iconify from '@src/components/iconify'; import { ReadResult } from '@lens-protocol/react/dist/declarations/src/helpers/reads'; import { uploadMetadataToIPFS } from '@src/utils/ipfs'; import uuidv4 from '@src/utils/uuidv4.ts'; -import {useDispatch, useSelector} from 'react-redux'; -import {useNotifications} from "@src/hooks/use-notifications.ts"; +import { useDispatch, useSelector } from 'react-redux'; +import { useNotifications } from '@src/hooks/use-notifications.ts'; import { useNotificationPayload } from '@src/hooks/use-notification-payload.ts'; -import {AnyPublication} from "@lens-protocol/api-bindings"; +import { AnyPublication } from '@lens-protocol/api-bindings'; // Define the props types type MovieCommentFormProps = { @@ -34,7 +34,7 @@ type MovieCommentFormProps = { id: string; displayName: string; avatar?: string; - } + }; }; /** @@ -86,7 +86,11 @@ const MovieCommentForm = ({ commentOn, owner, root }: MovieCommentFormProps) => id: uuid, attributes: [ { type: MetadataAttributeType.STRING, key: 'publication', value: commentOn }, - { type: MetadataAttributeType.STRING, key: 'creator', value: sessionData?.profile?.handle?.localName }, + { + type: MetadataAttributeType.STRING, + key: 'creator', + value: sessionData?.profile?.handle?.localName, + }, { type: MetadataAttributeType.STRING, key: 'app', value: 'watchit' }, ], content: data.comment, @@ -95,12 +99,15 @@ const MovieCommentForm = ({ commentOn, owner, root }: MovieCommentFormProps) => name: `Comment by ${sessionData?.profile?.handle?.localName}`, attributes: [ { display_type: MarketplaceMetadataAttributeDisplayType.STRING, value: commentOn }, - { display_type: MarketplaceMetadataAttributeDisplayType.STRING, value: sessionData?.profile?.handle?.localName }, + { + display_type: MarketplaceMetadataAttributeDisplayType.STRING, + value: sessionData?.profile?.handle?.localName, + }, { display_type: MarketplaceMetadataAttributeDisplayType.STRING, value: 'watchit' }, ], description: data.comment, external_url: `https://watchit.movie/comment/${uuid}`, - } + }, }); // Create a pending comment object @@ -113,7 +120,7 @@ const MovieCommentForm = ({ commentOn, owner, root }: MovieCommentFormProps) => }, // @ts-ignore operations: { - hasUpvoted: false + hasUpvoted: false, }, by: sessionData?.profile, createdAt: new Date().toISOString(), diff --git a/src/sections/publication/publication-new-wizard-summary.tsx b/src/sections/publication/publication-new-wizard-summary.tsx index 028d36e90..48019fb6c 100644 --- a/src/sections/publication/publication-new-wizard-summary.tsx +++ b/src/sections/publication/publication-new-wizard-summary.tsx @@ -14,10 +14,8 @@ export default function ReviewFinalizeForm({ onSubmit, onBack, data }: any) {Error loading replies: {error.message}
; @@ -40,7 +42,9 @@ const RepliesList = ({ parentCommentId }: Props) => { : replies; const repliesFiltered = (repliesWithPending ?? []) - .filter((comment) => !hiddenComments.some((hiddenComment: any) => hiddenComment.id === comment.id)) + .filter( + (comment) => !hiddenComments.some((hiddenComment: any) => hiddenComment.id === comment.id) + ) .filter((comment) => !comment.isHidden); return ( @@ -55,7 +59,7 @@ const RepliesList = ({ parentCommentId }: Props) => { marginBottom: '16px', marginRight: '16px', alignSelf: 'flex-end', - marginLeft: 'auto' + marginLeft: 'auto', }} /> )} diff --git a/src/sections/publication/view/publication-details-view.tsx b/src/sections/publication/view/publication-details-view.tsx index 7b5ebf4e5..b0f68cd91 100644 --- a/src/sections/publication/view/publication-details-view.tsx +++ b/src/sections/publication/view/publication-details-view.tsx @@ -30,15 +30,11 @@ import PublicationDetailMain from '@src/components/publication-detail-main.tsx'; import { useHasAccess } from '@src/hooks/use-has-access.ts'; import { SubscribeProfileModal } from '@src/components/subscribe-profile-modal.tsx'; import LoadingButton from '@mui/lab/LoadingButton'; -import {useDispatch, useSelector} from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; import { openLoginModal } from '@redux/auth'; // @ts-ignore import { ReadResult } from '@lens-protocol/react/dist/declarations/src/helpers/reads'; -import { - appId, - PublicationType, - usePublications, -} from '@lens-protocol/react-web'; +import { appId, PublicationType, usePublications } from '@lens-protocol/react-web'; const MAX_LINES = 5; @@ -123,25 +119,26 @@ export default function PublicationDetailsView({ id }: Props) { if (loading || accessLoading) return