Skip to content

Commit 3644a77

Browse files
authored
Merge branch 'master' into bugfix/file-input-icon
2 parents 8da3750 + a7de817 commit 3644a77

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/UserForm/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ import './UserForm.scss';
1212
import DatePicker from '../DatePicker';
1313

1414
const UserForm = ({ isEditing, isProfile, user, setUser, action }) => {
15-
const { loading } = useSelector(
15+
const { loading, success } = useSelector(
1616
(state) => ({
1717
loading: state.users.loading,
18+
success: state.users.success,
1819
}),
1920
shallowEqual
2021
);
2122

2223
const dispatch = useDispatch();
2324

2425
useEffect(() => {
26+
if (success) {
27+
setUser((prevState) => ({ ...prevState, file: null }));
28+
}
2529
return () => dispatch(usersCleanUp());
26-
}, [dispatch]);
30+
}, [dispatch, success]);
2731

2832
const onChangeHandler = useChangeHandler(setUser);
2933

src/pages/Users/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const Users = () => {
3030

3131
const dispatch = useDispatch();
3232

33-
const [search, setSearch] = useState();
33+
const [search, setSearch] = useState('');
3434

3535
useEffect(() => {
3636
if (isAdmin) {

0 commit comments

Comments
 (0)