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

Conversation

ianmcorvidae
Copy link
Member

this way it can be reopened to launch again.

@ianmcorvidae ianmcorvidae marked this pull request as ready for review December 3, 2024 20:25
@@ -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.

Copy link
Member

@slr71 slr71 left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I'm not sure how to answer the question that you had. It might be best to wait for @psarando to look this over before we deploy it. 😁

@ianmcorvidae ianmcorvidae requested a review from psarando December 4, 2024 16:04
@@ -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

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.

@ianmcorvidae ianmcorvidae merged commit 6e9c867 into cyverse-de:main Dec 5, 2024
6 checks passed
@ianmcorvidae
Copy link
Member Author

Thanks for the reviews! If it breaks stuff to have it where I do I haven't hit it yet, anyway, so sounds like that's probably good enough for now, haha.

@ianmcorvidae ianmcorvidae deleted the instantlaunch-hotfix-2 branch December 5, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants