Skip to content

Commit 7ea0b12

Browse files
committed
Update Missions.js
1 parent 55b19d5 commit 7ea0b12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/Missions.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { getMission, joinMission, leaveMission } from '../Redux/Missions/mission
77

88
const MissionsComponent = () => {
99
const missions = useSelector((state) => state.missions.missions);
10-
console.log(missions);
10+
1111
const dispatch = useDispatch();
1212

1313
useEffect(() => {
14-
dispatch(getMission());
14+
if (missions.length === 0) {
15+
dispatch(getMission());
16+
}
1517
}, [dispatch]);
1618

1719
const join = (id) => {

0 commit comments

Comments
 (0)