mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Webatrice updates (#4366)
This commit is contained in:
parent
8db9475804
commit
0d05f9097d
14 changed files with 5517 additions and 20090 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React, { Component } from "react";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { Redirect } from "react-router-dom";
|
||||
|
||||
|
|
@ -7,12 +7,10 @@ import { RouteEnum } from "types";
|
|||
|
||||
import { AuthenticationService } from "api";
|
||||
|
||||
class AuthGuard extends Component<AuthGuardProps> {
|
||||
render() {
|
||||
return !AuthenticationService.isConnected(this.props.state)
|
||||
? <Redirect from="*" to={RouteEnum.SERVER} />
|
||||
: "";
|
||||
}
|
||||
const AuthGuard = ({ state }: AuthGuardProps) => {
|
||||
return !AuthenticationService.isConnected(state)
|
||||
? <Redirect from="*" to={RouteEnum.SERVER} />
|
||||
: <div></div>;
|
||||
};
|
||||
|
||||
interface AuthGuardProps {
|
||||
|
|
@ -23,4 +21,4 @@ const mapStateToProps = state => ({
|
|||
state: ServerSelectors.getState(state),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(AuthGuard);
|
||||
export default connect(mapStateToProps)(AuthGuard);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue