Revert "Say goodbye to the user when he logs out"

This reverts commit 7b38b503
This commit is contained in:
Felix Hamme 2019-04-27 13:27:11 +02:00
parent 7b38b503ef
commit bf8a9431bf
2 changed files with 7 additions and 13 deletions

View File

@ -38,7 +38,7 @@ const actiontypes_userinfo = {
const defaultstate_userinfo = {
isSignedIn : false,
wasGreeted : true,
wasGreeted : false,
username : null,
error : false,
errorMessages : [],
@ -261,7 +261,6 @@ const reducer_userinfo = (state = defaultstate_userinfo, action) => {
case actiontypes_userinfo.CLEAR:
return Object.assign({}, state, {
isSignedIn : false,
wasGreeted : false,
username : null,
error : false,
errorMessages : [],

View File

@ -14,7 +14,7 @@ import { connect } from 'react-redux';
import React from 'react';
import {greet, logout} from '../api';
import {notify} from 'react-notify-toast';
import {notify} from "react-notify-toast";
export class TurniereNavigation extends React.Component {
@ -70,12 +70,12 @@ class InvisibleLoginLogoutButtons extends React.Component {
render() {
const {isSignedIn, username, wasGreeted} = this.props;
if(isSignedIn) {
if (!wasGreeted) {
notify.show('Willkommen, ' + username + '!', 'success', 2500);
greet();
}
if (isSignedIn && !wasGreeted) {
notify.show('Willkommen, ' + username + '!', 'success', 3000);
greet();
}
if(isSignedIn) {
return (
<ButtonGroup className="nav-item">
<Button outline color="success" href="/profile" className="navbar-btn my-2 my-sm-0 px-5">{ username }</Button>
@ -83,11 +83,6 @@ class InvisibleLoginLogoutButtons extends React.Component {
</ButtonGroup>
);
} else {
if (!wasGreeted) {
notify.show('Du bist jetzt abgemeldet!', 'success', 2500);
greet();
}
return (
<ButtonGroup className="nav-item">
<Button outline color="success" href="/login" className="navbar-btn my-2 my-sm-0 px-5">Login</Button>