1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-05 15:30:14 +01:00

fix: unauthenticated dialog not shown

This commit is contained in:
Elias Schneider 2022-12-06 11:05:04 +01:00
parent 5ea63fb60b
commit 4a016ed57d
2 changed files with 11 additions and 15 deletions

View File

@ -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,
@ -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
@ -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>

View File

@ -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>