Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset hasLaunched after closing the instant launch dialog #609

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/instantlaunches/InstantLaunchButtonWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ function InstantLaunchButtonWrapper(props) {
window.open(`${getHost()}${ilUrl}`);
setIlUrl(null);
setOpen(false);
// reset the value so after it closes you can launch a second by reopening
setHasLaunched(false);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing I'm not sure about here is: should I instead reset this in the onClick function when the dialog is reopened, leaving it set to true while the dialog is closed? Or does it not make any real difference, heh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it doesn't seem to make a difference, but there's a lot of state and effects to juggle in this component, and it's a bit challenging to follow all the edge cases without actually interacting with it (either in dev mode or in storybook) 😅

But I think it makes more sense to me to reset it here.

if (autolaunch) {
// go to the analysis landing, not keeping this page in browser history
router.replace(landingUrl);
Expand Down
2 changes: 1 addition & 1 deletion src/components/instantlaunches/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const InstantLaunchSubmissionDialog = ({
<DialogContent>
{appInfo && (
<Typography variant="body1">
{resource
{resource && resource.path
? t("launchingAppWithData", {
appName: appInfo.name,
path: resource.path,
Expand Down
Loading