mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-02 03:54:59 +08:00
cleanup (structure): update code structure
This commit is contained in:
28
client/pages/homepage.js
Normal file
28
client/pages/homepage.js
Normal file
@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import { Session } from '../data';
|
||||
import { Loader } from '../utilities';
|
||||
|
||||
export class HomePage extends React.Component {
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
Session.isLogged()
|
||||
.then((res) => {
|
||||
if(res === true){
|
||||
this.props.history.push('/files');
|
||||
}else{
|
||||
this.props.history.push('/login');
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
console.warn(res)
|
||||
})
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div> <Loader /> </div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user