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:
parent
1dcf0753ea
commit
d2893d1fa3
1 changed files with 20 additions and 16 deletions
|
@ -8,10 +8,13 @@ import { CommentContextProvider } from '~/utils/context/CommentContextProvider';
|
||||||
import { useImageModal } from '~/utils/hooks/useImageModal';
|
import { useImageModal } from '~/utils/hooks/useImageModal';
|
||||||
import { useNodeComments } from '~/utils/hooks/node/useNodeComments';
|
import { useNodeComments } from '~/utils/hooks/node/useNodeComments';
|
||||||
import { useBoris } from '~/utils/hooks/boris/useBoris';
|
import { useBoris } from '~/utils/hooks/boris/useBoris';
|
||||||
|
import { NodeContextProvider } from '~/utils/context/NodeContextProvider';
|
||||||
|
|
||||||
const BorisPage: VFC = () => {
|
const BorisPage: VFC = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const {
|
const {
|
||||||
|
current,
|
||||||
|
is_loading,
|
||||||
comments,
|
comments,
|
||||||
comment_count: count,
|
comment_count: count,
|
||||||
is_loading_comments: isLoadingComments,
|
is_loading_comments: isLoadingComments,
|
||||||
|
@ -20,27 +23,28 @@ const BorisPage: VFC = () => {
|
||||||
const onShowImageModal = useImageModal();
|
const onShowImageModal = useImageModal();
|
||||||
const { onLoadMoreComments, onDelete: onDeleteComment } = useNodeComments(696);
|
const { onLoadMoreComments, onDelete: onDeleteComment } = useNodeComments(696);
|
||||||
const { title, setIsBetaTester, isTester, stats } = useBoris(comments);
|
const { title, setIsBetaTester, isTester, stats } = useBoris(comments);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(nodeLoadNode(696, 'DESC'));
|
dispatch(nodeLoadNode(696, 'DESC'));
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CommentContextProvider
|
<NodeContextProvider node={current} isLoading={is_loading}>
|
||||||
comments={comments}
|
<CommentContextProvider
|
||||||
count={count}
|
comments={comments}
|
||||||
isLoading={isLoadingComments}
|
count={count}
|
||||||
onShowImageModal={onShowImageModal}
|
isLoading={isLoadingComments}
|
||||||
onLoadMoreComments={onLoadMoreComments}
|
onShowImageModal={onShowImageModal}
|
||||||
onDeleteComment={onDeleteComment}
|
onLoadMoreComments={onLoadMoreComments}
|
||||||
>
|
onDeleteComment={onDeleteComment}
|
||||||
<BorisLayout
|
>
|
||||||
title={title}
|
<BorisLayout
|
||||||
setIsBetaTester={setIsBetaTester}
|
title={title}
|
||||||
isTester={isTester}
|
setIsBetaTester={setIsBetaTester}
|
||||||
stats={stats}
|
isTester={isTester}
|
||||||
/>
|
stats={stats}
|
||||||
</CommentContextProvider>
|
/>
|
||||||
|
</CommentContextProvider>
|
||||||
|
</NodeContextProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue