Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15,068 changes: 8,339 additions & 6,729 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@fortawesome/react-fontawesome": "0.1.16",
"@tensorflow-models/blazeface": "0.0.7",
"@tensorflow/tfjs-converter": "1.7.4",
"@tensorflow/tfjs-core": "1.7.4",
"@tensorflow/tfjs-converter": "3.18.0",
"@tensorflow/tfjs-core": "3.18.0",
"bowser": "2.11.0",
"classnames": "2.3.1",
"core-js": "3.19.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ function CertificatePreference({
saveState,
useVerifiedNameForCerts,
}) {
if (!originalVerifiedName) {
// If the user doesn't have an approved verified name, do not display this component
return null;
}

const dispatch = useDispatch();
const [checked, setChecked] = useState(false);
const [modalIsOpen, setModalIsOpen] = useState(false);
Expand Down Expand Up @@ -75,21 +70,27 @@ function CertificatePreference({
}

useEffect(() => {
if (fieldName === 'verified_name') {
setChecked(useVerifiedNameForCerts);
} else {
setChecked(!useVerifiedNameForCerts);
if (originalVerifiedName) {
if (fieldName === 'verified_name') {
setChecked(useVerifiedNameForCerts);
} else {
setChecked(!useVerifiedNameForCerts);
}
}
}, [useVerifiedNameForCerts]);
}, [originalVerifiedName, fieldName, useVerifiedNameForCerts]);

useEffect(() => {
if (modalIsOpen && saveState === 'complete') {
setModalIsOpen(false);
dispatch(closeForm(fieldName));
if (originalVerifiedName) {
if (modalIsOpen && saveState === 'complete') {
setModalIsOpen(false);
dispatch(closeForm(fieldName));
}
}
}, [modalIsOpen, saveState]);
}, [dispatch, originalVerifiedName, fieldName, modalIsOpen, saveState]);

// If the user doesn't have an approved verified name, do not display this component

return (
return originalVerifiedName ? (
<>
<Form.Checkbox className="mt-1 mb-4" checked={checked} onChange={handleCheckboxChange}>
{intl.formatMessage(messages['account.settings.field.name.checkbox.certificate.select'])}
Expand Down Expand Up @@ -150,7 +151,7 @@ function CertificatePreference({
</Form>
</ModalDialog>
</>
);
) : null;
}

CertificatePreference.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,14 @@ Array [
"width": "1px",
}
}
tabIndex={0}
tabIndex={-1}
/>
<div
data-focus-lock-disabled={false}
data-focus-lock-disabled="disabled"
onBlur={[Function]}
onFocus={[Function]}
onMouseDown={[Function]}
onScrollCapture={[Function]}
onTouchMoveCapture={[Function]}
onTouchStart={[Function]}
onWheelCapture={[Function]}
>
<div
Expand Down Expand Up @@ -513,7 +511,7 @@ Array [
"width": "1px",
}
}
tabIndex={0}
tabIndex={-1}
/>
</div>
</div>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,14 @@ Array [
"width": "1px",
}
}
tabIndex={0}
tabIndex={-1}
/>
<div
data-focus-lock-disabled={false}
data-focus-lock-disabled="disabled"
onBlur={[Function]}
onFocus={[Function]}
onMouseDown={[Function]}
onScrollCapture={[Function]}
onTouchMoveCapture={[Function]}
onTouchStart={[Function]}
onWheelCapture={[Function]}
>
<div
Expand Down Expand Up @@ -480,7 +478,7 @@ Array [
"width": "1px",
}
}
tabIndex={0}
tabIndex={-1}
/>
</div>
</div>,
Expand Down
2 changes: 1 addition & 1 deletion src/account-settings/demographics/Checkboxes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Checkboxes = (props) => {
const [selected, setSelected] = useState(values);
useEffect(() => {
onChange(id, selected);
}, [selected]);
}, [id, onChange, selected]);

const handleToggle = (value, option) => {
// If the user checked 'declined', uncheck all other options
Expand Down
12 changes: 6 additions & 6 deletions src/account-settings/name-change/NameChange.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { connect, useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -34,20 +34,20 @@ function NameChangeModal({
const [verifiedNameInput, setVerifiedNameInput] = useState(formValues.verified_name || '');
const [confirmedWarning, setConfirmedWarning] = useState(false);

function resetLocalState() {
const resetLocalState = useCallback(() => {
setConfirmedWarning(false);
dispatch(requestNameChangeReset());
}
}, [dispatch]);

function handleChange(e) {
setVerifiedNameInput(e.target.value);
}

function handleClose() {
const handleClose = useCallback(() => {
resetLocalState();
dispatch(closeForm(targetFormId));
dispatch(saveSettingsReset());
}
}, [dispatch, resetLocalState, targetFormId]);

function handleSubmit(e) {
e.preventDefault();
Expand All @@ -71,7 +71,7 @@ function NameChangeModal({
handleClose();
push(`/id-verification?next=${encodeURIComponent('account/settings')}`);
}
}, [saveState]);
}, [handleClose, push, saveState]);

function renderErrors() {
if (Object.keys(errors).length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/id-verification/ImageFileUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function ImageFileUpload({ onFileChange, intl }) {
});
fileReader.readAsDataURL(fileObject);
}
}, []);
}, [errorTypes.fileTooLarge, errorTypes.invalidFileType, onFileChange]);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/id-verification/panels/BasePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function BasePanel({
if (focusOnMount && headingRef.current) {
headingRef.current.focus();
}
}, [headingRef.current]);
}, [focusOnMount]);

const redirectSlug = useVerificationRedirectSlug(name);
if (redirectSlug) {
Expand Down
2 changes: 1 addition & 1 deletion src/id-verification/panels/GetNameIdPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function GetNameIdPanel(props) {
if (location.state?.fromSummary && nameInputRef.current) {
nameInputRef.current.focus();
}
}, []);
}, [idPhotoName, location.state, nameOnAccountValue, setIdPhotoName]);

function handleSubmit(e) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/id-verification/panels/SummaryPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function SummaryPanel(props) {
const [isSubmitting, setIsSubmitting] = useState(false);
const [submissionError, setSubmissionError] = useState(null);

useEffect(() => setReachedSummary(true), []);
useEffect(() => setReachedSummary(true), [setReachedSummary]);

function renderManagedProfileMessage() {
if (!profileDataManager) {
Expand Down