diff --git a/src/components/apps/launch/index.js b/src/components/apps/launch/index.js index 030e0f290..5267df260 100644 --- a/src/components/apps/launch/index.js +++ b/src/components/apps/launch/index.js @@ -80,7 +80,7 @@ const Launch = ({ ); const preferences = bootstrapInfo?.preferences; - const notify = preferences?.enableAnalysisEmailNotification || false; + const notify = !!preferences?.enableAnalysisEmailNotification; const notifyPeriodic = !!preferences?.enablePeriodicEmailNotification; const periodicPeriod = preferences?.periodicNotificationPeriod || 14400; diff --git a/src/components/instantlaunches/InstantLaunchButtonWrapper.js b/src/components/instantlaunches/InstantLaunchButtonWrapper.js index e2a95ba39..423b09a8b 100644 --- a/src/components/instantlaunches/InstantLaunchButtonWrapper.js +++ b/src/components/instantlaunches/InstantLaunchButtonWrapper.js @@ -22,6 +22,7 @@ import VicePendingRequestDlg from "components/vice/VicePendingRequestDlg"; import constants from "constants.js"; import { useUserProfile } from "contexts/userProfile"; +import { useBootstrapInfo } from "contexts/bootstrap"; import ids from "./ids"; import { InstantLaunchSubmissionDialog } from "./index"; import { instantlyLaunch } from "serviceFacades/instantlaunches"; @@ -38,6 +39,7 @@ function InstantLaunchButtonWrapper(props) { } = props; const output_dir = useDefaultOutputDir(); const [userProfile] = useUserProfile(); + const [bootstrapInfo] = useBootstrapInfo(); const [open, setOpen] = React.useState(false); const [signInDlgOpen, setSignInDlgOpen] = React.useState(false); @@ -105,7 +107,12 @@ function InstantLaunchButtonWrapper(props) { showErrorAnnouncer(t("computeLimitExceededMsg")); } else { setOpen(true); - launch({ instantLaunch, resource, output_dir }); + launch({ + instantLaunch, + resource, + output_dir, + preferences: bootstrapInfo?.preferences, + }); } } else { setSignInDlgOpen(true); diff --git a/src/serviceFacades/instantlaunches.js b/src/serviceFacades/instantlaunches.js index 2667ab586..845e40b0f 100644 --- a/src/serviceFacades/instantlaunches.js +++ b/src/serviceFacades/instantlaunches.js @@ -325,7 +325,12 @@ export const deleteInstantLaunchHandler = async (id) => { * @param {Object} instantLaunch - The instant launch object returned by defaultInstantLaunch(). * @param {Object} resource - An array of resources to use as inputs to the instantly launched app. */ -export const instantlyLaunch = ({ instantLaunch, resource, output_dir }) => { +export const instantlyLaunch = ({ + instantLaunch, + resource, + output_dir, + preferences, +}) => { let savedLaunchId; // The saved launch ID, used to get app information. let savedLaunchPromise; // The promise used to get saved launch information. @@ -436,6 +441,12 @@ export const instantlyLaunch = ({ instantLaunch, resource, output_dir }) => { submission.output_dir = output_dir; return submission; }) + .then((submission) => ({ + ...submission, + notify: !!preferences?.enableAnalysisEmailNotification, + notify_periodic: !!preferences?.enablePeriodicEmailNotification, + periodic_period: preferences?.periodicNotificationPeriod || 14400, + })) .then((submission) => submitAnalysis(submission)) // submit the analysis .then((analysisResp) => getAnalysis(analysisResp.id)); };