1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Make API calls in componentDidMount instead of componentWillMount, closes #84

This commit is contained in:
Sonja Happ 2019-11-07 16:52:22 +01:00
parent b801a50901
commit d03d7bacdc
9 changed files with 9 additions and 9 deletions

View file

@ -48,7 +48,7 @@ class Home extends React.Component {
return '?';
}
componentWillMount() {
componentDidMount() {
//RestAPI.get('/api/v1/counts').then(response => {
// this.setState({ counts: response });
//});

View file

@ -120,7 +120,7 @@ class Dashboard extends React.Component {
}
componentWillMount() {
componentDidMount() {
//document.addEventListener('keydown', this.handleKeydown.bind(this));
if (this.state.dashboard.has('id') === false) {

View file

@ -54,7 +54,7 @@ class Projects extends React.Component {
};
}
componentWillMount() {
componentDidMount() {
AppDispatcher.dispatch({
type: 'projects/start-load',
token: this.state.sessionToken

View file

@ -80,7 +80,7 @@ class Scenario extends React.Component {
}
}
componentWillMount() {
componentDidMount() {
AppDispatcher.dispatch({
type: 'scenarios/start-load',
token: this.state.sessionToken

View file

@ -80,7 +80,7 @@ class Simulation extends React.Component {
}
}
componentWillMount() {
componentDidMount() {
AppDispatcher.dispatch({
type: 'simulations/start-load',
token: this.state.sessionToken

View file

@ -47,7 +47,7 @@ class SimulationModel extends React.Component {
};
}
componentWillMount() {
componentDidMount() {
AppDispatcher.dispatch({
type: 'simulationModels/start-load',
data: this.props.match.params.simulationModel,

View file

@ -88,7 +88,7 @@ class Simulators extends Component {
};
}
componentWillMount() {
componentDidMount() {
AppDispatcher.dispatch({
type: 'simulators/start-load',
token: this.state.sessionToken,

View file

@ -25,7 +25,7 @@ import { Redirect } from 'react-router-dom';
import AppDispatcher from '../common/app-dispatcher';
class Logout extends React.Component {
componentWillMount() {
componentDidMount() {
AppDispatcher.dispatch({
type: 'users/logout'
});

View file

@ -77,7 +77,7 @@ class Widget extends React.Component {
};
}
componentWillMount() {
componentDidMount() {
if (this.state.sessionToken == null) {
return;
}