Skip to content

Commit

Permalink
fix: unauthenticated dialog not shown
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Dec 6, 2022
1 parent 5ea63fb commit 4a016ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
14 changes: 6 additions & 8 deletions frontend/src/components/upload/modals/showCreateUploadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const showCreateUploadModal = (
modals: ModalsContextProps,
options: {
isUserSignedIn: boolean;
ALLOW_UNAUTHENTICATED_SHARES: boolean;
ENABLE_EMAIL_RECIPIENTS: boolean;
allowUnauthenticatedShares: boolean;
enableEmailRecepients: boolean;
},
uploadCallback: (
id: string,
Expand Down Expand Up @@ -62,15 +62,13 @@ const CreateUploadModalBody = ({
) => void;
options: {
isUserSignedIn: boolean;
ALLOW_UNAUTHENTICATED_SHARES: boolean;
ENABLE_EMAIL_RECIPIENTS: boolean;
allowUnauthenticatedShares: boolean;
enableEmailRecepients: boolean;
};
}) => {
const modals = useModals();

const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(
options.ENABLE_EMAIL_RECIPIENTS
);
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(true);

const validationSchema = yup.object().shape({
link: yup
Expand Down Expand Up @@ -230,7 +228,7 @@ const CreateUploadModalBody = ({
{ExpirationPreview({ form })}
</Text>
<Accordion>
{options.ENABLE_EMAIL_RECIPIENTS && (
{options.enableEmailRecepients && (
<Accordion.Item value="recipients" sx={{ borderBottom: "none" }}>
<Accordion.Control>Email recipients</Accordion.Control>
<Accordion.Panel>
Expand Down
12 changes: 5 additions & 7 deletions frontend/src/pages/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,19 @@ const Upload = () => {
<Button
loading={isUploading}
disabled={files.length <= 0}
onClick={() =>
onClick={() => {
showCreateUploadModal(
modals,
{
isUserSignedIn: user ? true : false,
ALLOW_UNAUTHENTICATED_SHARES: config.get(
allowUnauthenticatedShares: config.get(
"ALLOW_UNAUTHENTICATED_SHARES"
),
ENABLE_EMAIL_RECIPIENTS: config.get(
"ENABLE_EMAIL_RECIPIENTS"
),
enableEmailRecepients: config.get("ENABLE_EMAIL_RECIPIENTS"),
},
uploadFiles
)
}
);
}}
>
Share
</Button>
Expand Down

0 comments on commit 4a016ed

Please sign in to comment.