Skip to content

Commit 62559da

Browse files
lex111Houssein Djirdeh
authored andcommitted
fix(events): get user events after login (#390)
1 parent 35379d1 commit 62559da

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/auth/screens/events.screen.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import moment from 'moment/min/moment-with-locales.min';
99
import { LoadingUserListItem, UserListItem, ViewContainer } from 'components';
1010
import { colors, fonts, normalize } from 'config';
1111
import { emojifyText, translate } from 'utils';
12-
import { getUserEvents } from 'auth';
12+
import { getUserEvents, getUser } from 'auth';
1313
import { getNotificationsCount } from 'notifications';
1414

1515
const mapStateToProps = state => ({
@@ -25,6 +25,7 @@ const mapDispatchToProps = dispatch =>
2525
{
2626
getUserEvents,
2727
getNotificationsCount,
28+
getUser,
2829
},
2930
dispatch
3031
);
@@ -78,8 +79,12 @@ const styles = StyleSheet.create({
7879

7980
class Events extends Component {
8081
componentDidMount() {
81-
if (this.props.user.login) {
82+
const { user: { login }, getUser } = this.props;
83+
84+
if (login) {
8285
this.getUserEvents();
86+
} else {
87+
getUser();
8388
}
8489
}
8590

0 commit comments

Comments
 (0)