mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
(nextjs) fixed eslint warnings
This commit is contained in:
parent
c469722a86
commit
e5f8d5a551
29 changed files with 56 additions and 59 deletions
|
@ -3,8 +3,6 @@ import { ERRORS } from '~/constants/errors';
|
|||
import { useCallback } from 'react';
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { showToastSuccess } from '~/utils/toast';
|
||||
import { getRandomPhrase } from '~/constants/phrases';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
import { getValidationErrors } from '~/utils/errors/getValidationErrors';
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { useCallback } from 'react';
|
||||
import { apiUserLogin } from '~/api/auth';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
import { getRandomPhrase } from '~/constants/phrases';
|
||||
import { showToastInfo, showToastSuccess } from '~/utils/toast';
|
||||
import { showToastInfo } from '~/utils/toast';
|
||||
|
||||
export const useLoginLogoutRestore = () => {
|
||||
const auth = useAuthStore();
|
||||
|
|
|
@ -16,6 +16,7 @@ export const useScrollToTop = (deps?: any[]) => {
|
|||
top: bounds.top - 100,
|
||||
});
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
deps && Array.isArray(deps) ? deps : []
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@ import { useCallback, useState } from 'react';
|
|||
import { getNodeDiff } from '~/api/node';
|
||||
import { uniq } from 'ramda';
|
||||
import { useFlowStore } from '~/store/flow/useFlowStore';
|
||||
import { runInAction, toJS } from 'mobx';
|
||||
import { runInAction } from 'mobx';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
export const useFlowLoader = () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import useSWR from 'swr';
|
||||
import { ApiGetNodeRequest, ApiGetNodeResponse } from '~/types/node';
|
||||
import { ApiGetNodeResponse } from '~/types/node';
|
||||
import { API } from '~/constants/api';
|
||||
import { useOnNodeSeen } from '~/hooks/node/useOnNodeSeen';
|
||||
import { apiGetNode } from '~/api/node';
|
||||
|
|
|
@ -41,7 +41,10 @@ export const useNodeActions = (node: INode, update: (node: Partial<INode>) => Pr
|
|||
}
|
||||
}, [node.deleted_at, node.id, update]);
|
||||
|
||||
const onEdit = useCallback(() => showModal(Dialog.EditNode, { nodeId: node.id! }), [node]);
|
||||
const onEdit = useCallback(() => showModal(Dialog.EditNode, { nodeId: node.id! }), [
|
||||
node,
|
||||
showModal,
|
||||
]);
|
||||
|
||||
return { onLike, onStar, onLock, onEdit };
|
||||
};
|
||||
|
|
|
@ -4,6 +4,8 @@ import { CONFIG } from '~/utils/config';
|
|||
|
||||
export const useNodePageParams = () => {
|
||||
return CONFIG.isNextEnvironment
|
||||
? (useRouter().query.id as string)
|
||||
: useRouteMatch<{ id: string }>().params.id;
|
||||
? // eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
(useRouter().query.id as string)
|
||||
: // eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useRouteMatch<{ id: string }>().params.id;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue