From 8044b0a436042394018e9fd327d27bad736c0c02 Mon Sep 17 00:00:00 2001
From: Joni Laukka <joni.laukka.overflow@gmail.com>
Date: Tue, 25 Jun 2019 11:11:50 +0300
Subject: [PATCH] Edit game button does not show up if user is not logged in.

---
 src/components/GameList.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/GameList.js b/src/components/GameList.js
index 63661dc..6b68d64 100644
--- a/src/components/GameList.js
+++ b/src/components/GameList.js
@@ -67,7 +67,8 @@ class GameList extends React.Component {
         <select onChange={this.handleChange}>
           {items}
         </select> 
-        <button onClick={this.handleEditClick}>Edit game</button>
+        {sessionStorage.getItem('token') 
+        && <button onClick={this.handleEditClick}>Edit game</button>}
         {(this.state.editForm && this.state.selectedGame !== null) 
           && <EditGameForm gameId={this.state.selectedGame} toggleView={this.toggleView}/>}
       </Fragment>
-- 
GitLab