u
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { bootstrapSession } from '../store/authSlice';
|
||||
import { bootstrapSession as bootstrapSessionThunk } from '../store/authSlice';
|
||||
|
||||
let sessionBootstrapped = false;
|
||||
|
||||
class AuthBootstrap extends Component {
|
||||
componentDidMount() {
|
||||
if (sessionBootstrapped) return;
|
||||
sessionBootstrapped = true;
|
||||
|
||||
this.props
|
||||
.bootstrapSession()
|
||||
.unwrap()
|
||||
@@ -24,7 +29,7 @@ class AuthBootstrap extends Component {
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
bootstrapSession: () => dispatch(bootstrapSession()),
|
||||
bootstrapSession: () => dispatch(bootstrapSessionThunk()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps)(AuthBootstrap);
|
||||
|
||||
Reference in New Issue
Block a user