From dd6740e109d3afdeed80947b6b306b3badc4620f Mon Sep 17 00:00:00 2001 From: James Date: Sat, 12 Sep 2020 16:36:23 -0400 Subject: [PATCH] only shows LeaveWithoutSaving if user is logged in --- src/client/components/modals/LeaveWithoutSaving/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/components/modals/LeaveWithoutSaving/index.js b/src/client/components/modals/LeaveWithoutSaving/index.js index 61c3182043..221b12a79b 100644 --- a/src/client/components/modals/LeaveWithoutSaving/index.js +++ b/src/client/components/modals/LeaveWithoutSaving/index.js @@ -3,6 +3,7 @@ import NavigationPrompt from 'react-router-navigation-prompt'; import { useFormModified } from '../../forms/Form/context'; import MinimalTemplate from '../../templates/Minimal'; import Button from '../../elements/Button'; +import { useUser } from '../../data/User'; import './index.scss'; @@ -10,9 +11,10 @@ const modalSlug = 'leave-without-saving'; const LeaveWithoutSaving = () => { const modified = useFormModified(); + const { user } = useUser(); return ( - + {({ onConfirm, onCancel }) => (