mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
eslint auto-fix
This commit is contained in:
parent
312156bdf8
commit
4c4461ea19
55 changed files with 107 additions and 110 deletions
|
@ -15,7 +15,6 @@ import { ModalWrapper } from '~/components/dialogs/ModalWrapper';
|
|||
import { useTranslatedError } from '~/utils/hooks/useTranslatedError';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { EditorConfirmClose } from '~/components/editors/EditorConfirmClose';
|
||||
import { UploadDropzone } from '~/components/upload/UploadDropzone';
|
||||
|
||||
interface Props extends IDialogProps {
|
||||
node: INode;
|
||||
|
@ -46,7 +45,7 @@ const EditorDialog: FC<Props> = ({ node, onRequestClose }) => {
|
|||
}
|
||||
|
||||
setConfirmModalShown(true);
|
||||
}, [onRequestClose, dirty, isConfirmModalShown, setConfirmModalShown]);
|
||||
}, [dirty, isConfirmModalShown, onRequestClose, closeConfirmModal]);
|
||||
|
||||
const error = useTranslatedError(status);
|
||||
|
||||
|
@ -56,7 +55,7 @@ const EditorDialog: FC<Props> = ({ node, onRequestClose }) => {
|
|||
}
|
||||
|
||||
setStatus('');
|
||||
}, [values]);
|
||||
}, [setStatus, status, values]);
|
||||
|
||||
useCloseOnEscape(onClose);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { FC, FormEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import React, { FC, FormEvent, useCallback, useEffect, useState } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { DIALOGS, IDialogProps } from '~/redux/modal/constants';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
|
@ -18,7 +18,6 @@ import { pick } from 'ramda';
|
|||
import { LoginDialogButtons } from '~/containers/dialogs/LoginDialogButtons';
|
||||
import { OAUTH_EVENT_TYPES } from '~/redux/types';
|
||||
import { DialogTitle } from '~/components/dialogs/DialogTitle';
|
||||
import { ERROR_LITERAL } from '~/constants/errors';
|
||||
import { useTranslatedError } from '~/utils/hooks/useTranslatedError';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
|
@ -60,7 +59,7 @@ const LoginDialogUnconnected: FC<IProps> = ({
|
|||
event.preventDefault();
|
||||
modalShowDialog(DIALOGS.RESTORE_REQUEST);
|
||||
},
|
||||
[modalShowDialog, userSetLoginError]
|
||||
[modalShowDialog]
|
||||
);
|
||||
|
||||
const openOauthWindow = useCallback(
|
||||
|
@ -83,7 +82,7 @@ const LoginDialogUnconnected: FC<IProps> = ({
|
|||
|
||||
useEffect(() => {
|
||||
if (error) userSetLoginError('');
|
||||
}, [username, password]);
|
||||
}, [username, password, error, userSetLoginError]);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('message', onMessage);
|
||||
|
|
|
@ -51,15 +51,15 @@ const LoginSocialRegisterDialogUnconnected: FC<Props> = ({
|
|||
|
||||
useEffect(() => {
|
||||
if (errors.username) authSetRegisterSocialErrors({ username: '' });
|
||||
}, [username]);
|
||||
}, [authSetRegisterSocialErrors, errors.username, username]);
|
||||
|
||||
useEffect(() => {
|
||||
if (errors.password) authSetRegisterSocialErrors({ password: '' });
|
||||
}, [password]);
|
||||
}, [authSetRegisterSocialErrors, errors.password, password]);
|
||||
|
||||
useEffect(() => {
|
||||
if (error) authSetRegisterSocial({ error: '' });
|
||||
}, [username, password]);
|
||||
}, [username, password, error, authSetRegisterSocial]);
|
||||
|
||||
useCloseOnEscape(onRequestClose);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ const PhotoSwipeUnconnected: FC<Props> = ({ photoswipe, modalSetShown }) => {
|
|||
ps.listen('destroy', closeModal);
|
||||
ps.listen('close', closeModal);
|
||||
});
|
||||
}, [photoswipe.images, photoswipe.index]);
|
||||
}, [closeModal, photoswipe.images, photoswipe.index]);
|
||||
|
||||
useBlockBackButton(closeModal);
|
||||
|
||||
|
|
|
@ -44,14 +44,14 @@ const RestorePasswordDialogUnconnected: FC<IProps> = ({
|
|||
|
||||
authRestorePassword(password);
|
||||
},
|
||||
[doesnt_match, authRestorePassword]
|
||||
[doesnt_match, authRestorePassword, password]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (error || is_succesfull) {
|
||||
authSetRestore({ error: '', is_succesfull: false });
|
||||
}
|
||||
}, [password, password_again]);
|
||||
}, [authSetRestore, error, is_succesfull, password, password_again]);
|
||||
|
||||
const buttons = useMemo(
|
||||
() => (
|
||||
|
@ -80,7 +80,7 @@ const RestorePasswordDialogUnconnected: FC<IProps> = ({
|
|||
) : (
|
||||
undefined
|
||||
),
|
||||
[is_succesfull]
|
||||
[is_succesfull, onRequestClose, user]
|
||||
);
|
||||
|
||||
const not_ready = useMemo(
|
||||
|
@ -105,7 +105,7 @@ const RestorePasswordDialogUnconnected: FC<IProps> = ({
|
|||
) : (
|
||||
undefined
|
||||
),
|
||||
[is_loading, user, error]
|
||||
[is_loading, user, error, onRequestClose]
|
||||
);
|
||||
|
||||
useCloseOnEscape(onRequestClose);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { FC, useState, useMemo, useCallback, useEffect } from 'react';
|
||||
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { IDialogProps } from '~/redux/types';
|
||||
import { connect } from 'react-redux';
|
||||
import { BetterScrollDialog } from '../BetterScrollDialog';
|
||||
|
@ -45,7 +45,7 @@ const RestoreRequestDialogUnconnected: FC<IProps> = ({
|
|||
if (error || is_succesfull) {
|
||||
authSetRestore({ error: '', is_succesfull: false });
|
||||
}
|
||||
}, [field]);
|
||||
}, [authSetRestore, error, field, is_succesfull]);
|
||||
|
||||
const buttons = useMemo(
|
||||
() => (
|
||||
|
@ -75,7 +75,7 @@ const RestoreRequestDialogUnconnected: FC<IProps> = ({
|
|||
) : (
|
||||
undefined
|
||||
),
|
||||
[is_succesfull]
|
||||
[is_succesfull, onRequestClose]
|
||||
);
|
||||
|
||||
useCloseOnEscape(onRequestClose);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue