diff --git a/src/components/boris/BorisStats/index.tsx b/src/components/boris/BorisStats/index.tsx index e60b91d7..62d3634b 100644 --- a/src/components/boris/BorisStats/index.tsx +++ b/src/components/boris/BorisStats/index.tsx @@ -1,5 +1,5 @@ import React, { FC } from 'react'; -import { BorisUsageStats, IBorisState } from '~/redux/boris/reducer'; +import { BorisUsageStats } from '~/redux/boris/reducer'; import { BorisStatsGit } from '../BorisStatsGit'; import { BorisStatsBackend } from '../BorisStatsBackend'; diff --git a/src/components/input/Button/index.tsx b/src/components/input/Button/index.tsx index aacccad6..52c67444 100644 --- a/src/components/input/Button/index.tsx +++ b/src/components/input/Button/index.tsx @@ -48,7 +48,19 @@ const Button: FC = memo( has_icon_right: !!iconRight, round, }), - [className, size, color, disabled, stretchy, iconLeft, iconRight, title, children, iconOnly, round] + [ + className, + size, + color, + disabled, + stretchy, + iconLeft, + iconRight, + title, + children, + iconOnly, + round, + ] ); return ( diff --git a/src/components/node/NodeTextBlock/index.tsx b/src/components/node/NodeTextBlock/index.tsx index 206e0202..a22daa3f 100644 --- a/src/components/node/NodeTextBlock/index.tsx +++ b/src/components/node/NodeTextBlock/index.tsx @@ -9,7 +9,9 @@ import markdown from '~/styles/common/markdown.module.scss'; interface IProps extends INodeComponentProps {} const NodeTextBlock: FC = ({ node }) => { - const content = useMemo(() => formatTextParagraphs(path(['blocks', 0, 'text'], node) || ''), [node]); + const content = useMemo(() => formatTextParagraphs(path(['blocks', 0, 'text'], node) || ''), [ + node, + ]); return (
{ lastSeenCurrent, } = useShallowSelect(selectNode); - useLoadNode(id, isLoading); + useLoadNode(id); useOnNodeSeen(node); return { node, comments, commentsCount, related, lastSeenCurrent, isLoading, isLoadingComments }; diff --git a/src/utils/hooks/node/useLoadNode.ts b/src/utils/hooks/node/useLoadNode.ts index af98e7a6..03eee3d0 100644 --- a/src/utils/hooks/node/useLoadNode.ts +++ b/src/utils/hooks/node/useLoadNode.ts @@ -4,15 +4,14 @@ import { useDispatch } from 'react-redux'; import { EMPTY_NODE } from '~/redux/node/constants'; // useLoadNode loads node on id change -export const useLoadNode = (id: any, isLoading: boolean) => { +export const useLoadNode = (id: any) => { const dispatch = useDispatch(); useEffect(() => { - if (isLoading) return; dispatch(nodeGotoNode(parseInt(id, 10), undefined)); return () => { dispatch(nodeSetCurrent(EMPTY_NODE)); }; - }, [dispatch, id, isLoading]); + }, [dispatch, id]); }; diff --git a/src/utils/hooks/useInputPasteUpload.ts b/src/utils/hooks/useInputPasteUpload.ts index b4574cf2..ac206365 100644 --- a/src/utils/hooks/useInputPasteUpload.ts +++ b/src/utils/hooks/useInputPasteUpload.ts @@ -6,13 +6,16 @@ export const useInputPasteUpload = ( input: HTMLTextAreaElement | HTMLInputElement | undefined, onUpload: (files: File[]) => void ) => { - const onPaste = useCallback(async event => { - const image = await getImageFromPaste(event); + const onPaste = useCallback( + async event => { + const image = await getImageFromPaste(event); - if (!image) return; + if (!image) return; - onUpload([image]); - }, [onUpload]); + onUpload([image]); + }, + [onUpload] + ); useEffect(() => { if (!input) return; diff --git a/src/utils/hooks/useNodeFormFormik.ts b/src/utils/hooks/useNodeFormFormik.ts index 851a1cb2..81aa1e9b 100644 --- a/src/utils/hooks/useNodeFormFormik.ts +++ b/src/utils/hooks/useNodeFormFormik.ts @@ -36,10 +36,13 @@ export const useNodeFormFormik = ( stopEditing: () => void ) => { const dispatch = useDispatch(); - const onSubmit = useCallback((values: INode, helpers: FormikHelpers) => { - helpers.setSubmitting(true); - dispatch(nodeSubmitLocal(values, onSuccess(helpers))); - }, [dispatch]); + const onSubmit = useCallback( + (values: INode, helpers: FormikHelpers) => { + helpers.setSubmitting(true); + dispatch(nodeSubmitLocal(values, onSuccess(helpers))); + }, + [dispatch] + ); const { current: initialValues } = useRef(values);