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

fix(setup): fix continue button disabled on refresh in setup 3 #1211

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

fallenbagel
Copy link
Owner

@fallenbagel fallenbagel commented Dec 31, 2024

Description

This pr resolves an issue where the continue button in setup step 3 remained disabled after a page refresh even when libraries are toggled. This was happening because mediaServerSettingsComplete state was reset on refresh and not correctly re-initialized.

  • The state is properly initialized from localStorage when the component mounts.
  • Validation for enabled libraries is done when the state is hydrated so the continue button state is correct
  • The continue button remains enabled if a library has already been toggled.

Screenshot (if UI-related)

Previously (there is a library enabled after refresh but continue button disabled until i re-toggle):
image

After this PR the continue button will always stay enabled if there is a library setup.

To-Dos

  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Issues Fixed or Closed

  • Fixes #XXXX

This commit resolves an issue where the continue button in setup step 3 remained disabled after a
page refresh even when libraries are toggled. This was happening because
`mediaServerSettingsComplete` state was reset on refresh and not correctly re-initialized.
Copy link
Collaborator

@gauthier-th gauthier-th left a comment

Choose a reason for hiding this comment

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

Shouldn't you also do localStorage.removeItem('mediaServerSettingsComplete'); when the setup is done?
Could it cause some issues when you do the setup process again (i.e. when resetting the settings.json)

@fallenbagel
Copy link
Owner Author

I actually have not tested that. I'll take a look at it

@gauthier-th
Copy link
Collaborator

Shouldn't you also do localStorage.removeItem('mediaServerSettingsComplete'); when the setup is done? Could it cause some issues when you do the setup process again (i.e. when resetting the settings.json)

Just tested and it works properly.

@gauthier-th gauthier-th merged commit 0b331ca into develop Jan 3, 2025
6 checks passed
@gauthier-th gauthier-th deleted the fix-state-management-in-setup branch January 3, 2025 11:22
@fallenbagel
Copy link
Owner Author

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants