Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No duplicated state in Comments #10228

Closed
Tracked by #10056
mxdvl opened this issue Jan 16, 2024 · 0 comments · Fixed by #10388, #10239 or #10284
Closed
Tracked by #10056

No duplicated state in Comments #10228

mxdvl opened this issue Jan 16, 2024 · 0 comments · Fixed by #10388, #10239 or #10284
Assignees

Comments

@mxdvl
Copy link
Contributor

mxdvl commented Jan 16, 2024

Lift all duplicated state and callbacks from Comments:

const [filters, setFilters] = useState<FilterOptions>(
initialiseFilters({
pageSizeOverride,
orderByOverride,
permalinkBeingUsed:
commentToScrollTo !== undefined &&
!Number.isNaN(commentToScrollTo),
isClosedForComments,
}),
);
const [loading, setLoading] = useState<boolean>(true);
const [totalPages, setTotalPages] = useState<number>(0);
const [page, setPage] = useState<number>(initialPage ?? 1);
const [picks, setPicks] = useState<CommentType[]>([]);
const [commentBeingRepliedTo, setCommentBeingRepliedTo] =
useState<CommentType>();
const [comments, setComments] = useState<CommentType[]>([]);
const [numberOfCommentsToShow, setNumberOfCommentsToShow] =
useState<number>(10);
const [commentCount, setCommentCount] = useState<number>(0);
const [mutes, setMutes] = useState<string[]>(readMutes());

@mxdvl mxdvl added this to the DCR for Apps milestone Jan 16, 2024
@mxdvl mxdvl added this to WebX Team Jan 16, 2024
@github-project-automation github-project-automation bot moved this to Triage in WebX Team Jan 16, 2024
@mxdvl mxdvl moved this from Triage to In Progress in WebX Team Jan 16, 2024
@mxdvl mxdvl changed the title Comments No duplicated state in Comments Jan 16, 2024
@mxdvl mxdvl moved this from In Progress to Review in WebX Team Jan 18, 2024
@abeddow91 abeddow91 moved this from Review to Done in WebX Team Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment