1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed lost node context on boris

This commit is contained in:
Fedor Katurov 2021-12-10 09:14:06 +07:00
parent 1dcf0753ea
commit d2893d1fa3

View file

@ -8,10 +8,13 @@ import { CommentContextProvider } from '~/utils/context/CommentContextProvider';
import { useImageModal } from '~/utils/hooks/useImageModal';
import { useNodeComments } from '~/utils/hooks/node/useNodeComments';
import { useBoris } from '~/utils/hooks/boris/useBoris';
import { NodeContextProvider } from '~/utils/context/NodeContextProvider';
const BorisPage: VFC = () => {
const dispatch = useDispatch();
const {
current,
is_loading,
comments,
comment_count: count,
is_loading_comments: isLoadingComments,
@ -20,27 +23,28 @@ const BorisPage: VFC = () => {
const onShowImageModal = useImageModal();
const { onLoadMoreComments, onDelete: onDeleteComment } = useNodeComments(696);
const { title, setIsBetaTester, isTester, stats } = useBoris(comments);
useEffect(() => {
dispatch(nodeLoadNode(696, 'DESC'));
}, [dispatch]);
return (
<CommentContextProvider
comments={comments}
count={count}
isLoading={isLoadingComments}
onShowImageModal={onShowImageModal}
onLoadMoreComments={onLoadMoreComments}
onDeleteComment={onDeleteComment}
>
<BorisLayout
title={title}
setIsBetaTester={setIsBetaTester}
isTester={isTester}
stats={stats}
/>
</CommentContextProvider>
<NodeContextProvider node={current} isLoading={is_loading}>
<CommentContextProvider
comments={comments}
count={count}
isLoading={isLoadingComments}
onShowImageModal={onShowImageModal}
onLoadMoreComments={onLoadMoreComments}
onDeleteComment={onDeleteComment}
>
<BorisLayout
title={title}
setIsBetaTester={setIsBetaTester}
isTester={isTester}
stats={stats}
/>
</CommentContextProvider>
</NodeContextProvider>
);
};