diff --git a/functions/cleanShares/src/index.js b/functions/cleanShares/src/index.js index 44330271..d0de1e0b 100644 --- a/functions/cleanShares/src/index.js +++ b/functions/cleanShares/src/index.js @@ -4,7 +4,6 @@ module.exports = async function (req, res) { const client = new sdk.Client(); let database = new sdk.Database(client); - let storage = new sdk.Storage(client); client diff --git a/functions/createShare/src/index.js b/functions/createShare/src/index.js index 01ef8f57..b665d78c 100644 --- a/functions/createShare/src/index.js +++ b/functions/createShare/src/index.js @@ -35,7 +35,7 @@ module.exports = async function (req, res) { } let userIds; - if (payload.emails) { + if (payload.emails.length > 0) { const creatorEmail = (await users.get(userId)).email userIds = [] userIds.push(userId) diff --git a/src/components/share/showShareNotFoundModal.tsx b/src/components/share/showErrorModal.tsx similarity index 68% rename from src/components/share/showShareNotFoundModal.tsx rename to src/components/share/showErrorModal.tsx index b64241f8..f80bbc58 100644 --- a/src/components/share/showShareNotFoundModal.tsx +++ b/src/components/share/showErrorModal.tsx @@ -3,26 +3,28 @@ import { useModals } from "@mantine/modals"; import { ModalsContextProps } from "@mantine/modals/lib/context"; import { useRouter } from "next/router"; -const showShareNotFoundModal = (modals: ModalsContextProps) => { +const showErrorModal = ( + modals: ModalsContextProps, + title: string, + text: string +) => { return modals.openModal({ closeOnClickOutside: false, withCloseButton: false, closeOnEscape: false, - title: