From bf8a9431bfb42fadb564b7800c8681d4980303e9 Mon Sep 17 00:00:00 2001 From: Felix Hamme Date: Sat, 27 Apr 2019 13:27:11 +0200 Subject: [PATCH] Revert "Say goodbye to the user when he logs out" This reverts commit 7b38b503 --- js/api.js | 3 +-- js/components/Navigation.js | 17 ++++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/js/api.js b/js/api.js index aae8724..d178f70 100644 --- a/js/api.js +++ b/js/api.js @@ -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 : [], diff --git a/js/components/Navigation.js b/js/components/Navigation.js index cc4b07a..a1bbb77 100644 --- a/js/components/Navigation.js +++ b/js/components/Navigation.js @@ -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 ( @@ -83,11 +83,6 @@ class InvisibleLoginLogoutButtons extends React.Component { ); } else { - if (!wasGreeted) { - notify.show('Du bist jetzt abgemeldet!', 'success', 2500); - greet(); - } - return (