Skip to content

Commit acba346

Browse files
authored
Merge branch 'master' into feature/interface
2 parents 803a822 + 424f400 commit acba346

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/components/UserForm/index.jsx

Lines changed: 7 additions & 3 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

@@ -242,7 +246,7 @@ const UserForm = ({ isEditing, isProfile, user, setUser, action }) => {
242246
/>
243247
<span className="file-cta">
244248
<span className="file-icon">
245-
<i className="fas fa-upload" />
249+
<i className="mdi mdi-upload" />
246250
</span>
247251
<span className="file-label">
248252
{user.file

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)