mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-29 01:28:59 -05:00
fix: unauthenticated dialog not shown
This commit is contained in:
parent
5ea63fb60b
commit
4a016ed57d
2 changed files with 11 additions and 15 deletions
|
@ -29,8 +29,8 @@ const showCreateUploadModal = (
|
||||||
modals: ModalsContextProps,
|
modals: ModalsContextProps,
|
||||||
options: {
|
options: {
|
||||||
isUserSignedIn: boolean;
|
isUserSignedIn: boolean;
|
||||||
ALLOW_UNAUTHENTICATED_SHARES: boolean;
|
allowUnauthenticatedShares: boolean;
|
||||||
ENABLE_EMAIL_RECIPIENTS: boolean;
|
enableEmailRecepients: boolean;
|
||||||
},
|
},
|
||||||
uploadCallback: (
|
uploadCallback: (
|
||||||
id: string,
|
id: string,
|
||||||
|
@ -62,15 +62,13 @@ const CreateUploadModalBody = ({
|
||||||
) => void;
|
) => void;
|
||||||
options: {
|
options: {
|
||||||
isUserSignedIn: boolean;
|
isUserSignedIn: boolean;
|
||||||
ALLOW_UNAUTHENTICATED_SHARES: boolean;
|
allowUnauthenticatedShares: boolean;
|
||||||
ENABLE_EMAIL_RECIPIENTS: boolean;
|
enableEmailRecepients: boolean;
|
||||||
};
|
};
|
||||||
}) => {
|
}) => {
|
||||||
const modals = useModals();
|
const modals = useModals();
|
||||||
|
|
||||||
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(
|
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(true);
|
||||||
options.ENABLE_EMAIL_RECIPIENTS
|
|
||||||
);
|
|
||||||
|
|
||||||
const validationSchema = yup.object().shape({
|
const validationSchema = yup.object().shape({
|
||||||
link: yup
|
link: yup
|
||||||
|
@ -230,7 +228,7 @@ const CreateUploadModalBody = ({
|
||||||
{ExpirationPreview({ form })}
|
{ExpirationPreview({ form })}
|
||||||
</Text>
|
</Text>
|
||||||
<Accordion>
|
<Accordion>
|
||||||
{options.ENABLE_EMAIL_RECIPIENTS && (
|
{options.enableEmailRecepients && (
|
||||||
<Accordion.Item value="recipients" sx={{ borderBottom: "none" }}>
|
<Accordion.Item value="recipients" sx={{ borderBottom: "none" }}>
|
||||||
<Accordion.Control>Email recipients</Accordion.Control>
|
<Accordion.Control>Email recipients</Accordion.Control>
|
||||||
<Accordion.Panel>
|
<Accordion.Panel>
|
||||||
|
|
|
@ -105,21 +105,19 @@ const Upload = () => {
|
||||||
<Button
|
<Button
|
||||||
loading={isUploading}
|
loading={isUploading}
|
||||||
disabled={files.length <= 0}
|
disabled={files.length <= 0}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
showCreateUploadModal(
|
showCreateUploadModal(
|
||||||
modals,
|
modals,
|
||||||
{
|
{
|
||||||
isUserSignedIn: user ? true : false,
|
isUserSignedIn: user ? true : false,
|
||||||
ALLOW_UNAUTHENTICATED_SHARES: config.get(
|
allowUnauthenticatedShares: config.get(
|
||||||
"ALLOW_UNAUTHENTICATED_SHARES"
|
"ALLOW_UNAUTHENTICATED_SHARES"
|
||||||
),
|
),
|
||||||
ENABLE_EMAIL_RECIPIENTS: config.get(
|
enableEmailRecepients: config.get("ENABLE_EMAIL_RECIPIENTS"),
|
||||||
"ENABLE_EMAIL_RECIPIENTS"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
uploadFiles
|
uploadFiles
|
||||||
)
|
);
|
||||||
}
|
}}
|
||||||
>
|
>
|
||||||
Share
|
Share
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Add table
Reference in a new issue