From 90736a11ffa547ba252acccae3fc9f28c5f471fd Mon Sep 17 00:00:00 2001 From: Amine Mouafik Date: Fri, 29 Nov 2019 19:38:23 +0700 Subject: Disable/prevent access to some settings for non-logged users --- src/components/settings/recipes/RecipesDashboard.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/components/settings/recipes') diff --git a/src/components/settings/recipes/RecipesDashboard.js b/src/components/settings/recipes/RecipesDashboard.js index 877cbc588..d08e6cbc2 100644 --- a/src/components/settings/recipes/RecipesDashboard.js +++ b/src/components/settings/recipes/RecipesDashboard.js @@ -153,6 +153,8 @@ export default @injectSheet(styles) @observer class RecipesDashboard extends Com const communityRecipes = recipes.filter(r => !r.isDevRecipe); const devRecipes = recipes.filter(r => r.isDevRecipe); + const isLoggedIn = Boolean(localStorage.getItem('authToken')); + return (
@@ -265,7 +267,7 @@ export default @injectSheet(styles) @observer class RecipesDashboard extends Com showAddServiceInterface({ recipeId: recipe.id })} + onClick={() => isLoggedIn && showAddServiceInterface({ recipeId: recipe.id })} /> ))}
@@ -278,7 +280,7 @@ export default @injectSheet(styles) @observer class RecipesDashboard extends Com showAddServiceInterface({ recipeId: recipe.id })} + onClick={() => isLoggedIn && showAddServiceInterface({ recipeId: recipe.id })} /> ))}
-- cgit v1.2.3-70-g09d2