Skip to content

Commit

Permalink
Merge pull request #9724 from hicommonwealth/release/v1.7.1-x
Browse files Browse the repository at this point in the history
Release/v1.7.1 x
  • Loading branch information
ilijabojanovic authored Oct 30, 2024
2 parents 5ac4286 + cd61126 commit 91d0477
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/commonwealth/client/scripts/models/Comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export class Comment<T extends IUniqueId> {
id,
text,
author,
community_id,
Address,
community_id,
thread_id,
parent_id,
reactions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const Profile = ({ userId }: ProfileProps) => {
const [threads, setThreads] = useState<Thread[]>([]);
const [isOwner, setIsOwner] = useState<boolean>();
const [comments, setComments] = useState<CommentWithAssociatedThread[]>([]);

const { data, error, isLoading } = useFetchProfileByIdQuery({
userId,
apiCallEnabled: !!userId,
Expand All @@ -51,9 +50,9 @@ const Profile = ({ userId }: ProfileProps) => {
);
// @ts-expect-error <StrictNullChecks/>
setThreads(data.threads.map((t) => new Thread(t)));

// @ts-expect-error <StrictNullChecks/>
const responseComments = data.comments.map((c) => new Comment(c));

const commentsWithAssociatedThread = responseComments.map((c) => {
const thread = data.commentThreads.find(
// @ts-expect-error <StrictNullChecks/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ import { CWText } from '../component_kit/cw_text';
import { CWTag } from '../component_kit/new_designs/CWTag';
import type { CommentWithAssociatedThread } from './ProfileActivity';

type CommentWithThreadCommunity = CommentWithAssociatedThread & {
thread?: { community_id?: string };
};
type ProfileActivityRowProps = {
activity: CommentWithAssociatedThread | Thread;
};

const ProfileActivityRow = ({ activity }: ProfileActivityRowProps) => {
const navigate = useCommonNavigate();
const { communityId, createdAt, author, id } = activity;
const { createdAt, author, id } = activity;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const communityId =
(activity as CommentWithThreadCommunity)?.thread?.community_id ||
activity?.communityId;
let title: string;
let body: string = '';
if (activity instanceof Thread) {
Expand Down

0 comments on commit 91d0477

Please sign in to comment.