diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb587f89..0a6276eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - bundle variables: - VERSION: 0.0.5 + VERSION: 0.0.6 build-go: image: golang:1.16.2 diff --git a/docs/changelog.md b/docs/changelog.md index 835b0988..19a35080 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,7 @@ +# 0.0.6 +- Fix hitting dashboard when logged out +- Clean up app.js + # 0.0.5 - Only allow ItemType:Audio from Jellyfin - Fix NavBar for Mobile (Ugly hack but.. TO REWORK) diff --git a/web/src/Actions/auth.js b/web/src/Actions/auth.js index 606e31ee..8f37d2f4 100644 --- a/web/src/Actions/auth.js +++ b/web/src/Actions/auth.js @@ -3,11 +3,13 @@ import { REGISTER_FAIL, LOGIN_SUCCESS, LOGIN_FAIL, - } from "./types"; + LOGOUT, +} from "./types"; import { toast } from 'react-toastify'; import jwt from 'jwt-decode' import AuthService from "../Services/auth.service"; + import eventBus from "./eventBus"; export const register = (username, email, password) => (dispatch) => { return AuthService.register(username, email, password).then( @@ -85,12 +87,19 @@ import { ); }; - export const logout = () => (dispatch) => { - AuthService.logout(); + export const logout = (dispatch) => { + // Clear local data + AuthService.logout() - // dispatch({ - // type: LOGOUT, - // }); + // window.location.pathname("/") + window.location.reload() - window.location.reload(); + // TODO; Clear Redux - ENABLE THIS WHEN I FIGURE OUT HOW 2 DISPATCH + // dispatch({ + // type: LOGOUT, + // payload: {}, + // }); + + // // Issue to all listeners to reload + eventBus.dispatch(LOGOUT); }; diff --git a/web/src/App.js b/web/src/App.js index 657fc525..02c1c903 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -12,52 +12,23 @@ import Navigation from './Components/Navigation'; // import { logout } from './Actions/auth'; import { Route, Switch, withRouter } from 'react-router-dom'; -import { connect } from 'react-redux'; import { Component } from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; -function mapStateToProps(state) { - const { user } = state.auth; - return { - user, - }; -} - class App extends Component { constructor(props) { super(props); - // this.logOut = this.logOut.bind(this); - this.state = { - // showAdminBoard: false, - // currentUser: undefined, - // Don't even ask.. apparently you can't pass - // exact="true".. it has to be a bool :| true: true, }; } - - - // componentDidMount() { - // const user = this.props.user; - - // if (user) { - // this.setState({ - // currentUser: user, - // }); - // } - // } - - // logOut() { - // this.props.dispatch(logout()); - // } render() { return (