fix: only show not signed in warning if not signed in

This commit is contained in:
Elias Schneider
2022-10-29 22:55:46 +02:00
parent c8021a42b7
commit c6e1f07f51
3 changed files with 13 additions and 46 deletions

View File

@@ -29,6 +29,7 @@ const { publicRuntimeConfig } = getConfig();
const showCreateUploadModal = (
modals: ModalsContextProps,
isSignedIn: boolean,
uploadCallback: (
id: string,
expiration: string,
@@ -37,18 +38,25 @@ const showCreateUploadModal = (
) => {
return modals.openModal({
title: <Title order={4}>Share</Title>,
children: <CreateUploadModalBody uploadCallback={uploadCallback} />,
children: (
<CreateUploadModalBody
isSignedIn={isSignedIn}
uploadCallback={uploadCallback}
/>
),
});
};
const CreateUploadModalBody = ({
uploadCallback,
isSignedIn,
}: {
uploadCallback: (
id: string,
expiration: string,
security: ShareSecurity
) => void;
isSignedIn: boolean;
}) => {
const modals = useModals();
@@ -80,10 +88,9 @@ const CreateUploadModalBody = ({
},
validate: yupResolver(validationSchema),
});
return (
<Group>
{showNotSignedInAlert && (
{showNotSignedInAlert && !isSignedIn && (
<Alert
withCloseButton
onClose={() => setShowNotSignedInAlert(false)}