Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
17 changes: 15 additions & 2 deletions src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const propTypes = {
};

const defaultProps = {
redirectTo: '',
redirectTo: ROUTES.HOME,
};

class Expensify extends Component {
Expand Down Expand Up @@ -76,9 +76,22 @@ class Expensify extends Component {
<View style={styles.genericView} />
);
}

console.log(`this.state.authToken: ${this.state.authToken}`);
if (this.state.authToken === undefined) {
console.log('will got to login');
return (
<Router>
<Redirect to={ROUTES.SIGNIN} />
<Route path={[ROUTES.SIGNIN]} render={this.recordCurrentRoute} component={SignInPage} />
</Router>
);
}

console.log('will got to home page before' + this.props.redirectTo);
const redirectTo = !this.state.authToken ? ROUTES.SIGNIN : this.props.redirectTo;
console.log('will got to home page after' + redirectTo);
return (

// TODO: Mobile does not support Beforeunload
// <Beforeunload onBeforeunload={ActiveClientManager.removeClient}>
<Router>
Expand Down
1 change: 1 addition & 0 deletions src/lib/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function updateReportWithNewAction(reportID, reportAction) {
* Initialize our pusher subscriptions to listen for new report comments
*/
function subscribeToReportCommentEvents() {
console.log(`private-user-accountID-${currentUserAccountID}`);
const pusherChannelName = `private-user-accountID-${currentUserAccountID}`;
if (Pusher.isSubscribed(pusherChannelName) || Pusher.isAlreadySubscribing(pusherChannelName)) {
return;
Expand Down