-
Notifications
You must be signed in to change notification settings - Fork 186
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
Continue refactoring ProfileImportModal to eventually separate business logic from UI #1477
base: immutable-profile-pt6-profileinstallprovider-install
Are you sure you want to change the base?
Continue refactoring ProfileImportModal to eventually separate business logic from UI #1477
Commits on Oct 9, 2024
-
installProfileHandler: sanity check state before proceeding
Avoid unnecessary non-null assertions as that's a bad habit. Throw an error if components local state is invalid before starting the import.
Configuration menu - View commit details
-
Copy full SHA for cd39266 - Browse repository at this point
Copy the full SHA cd39266View commit details -
Simplify arguments of profileCreatedCallback
This makes the code easier to read and might make it easier to refactor the profileCreatedCallback further.
Configuration menu - View commit details
-
Copy full SHA for 14d4c08 - Browse repository at this point
Copy the full SHA 14d4c08View commit details -
Drop checking file extension when extracting imported profile
Profiles imported as code are always .r2z files. Previously user could choose the older .r2x format when importing profile from a file, but support for this was dropped recently, and only .r2z is supported now.
Configuration menu - View commit details
-
Copy full SHA for 8a047b5 - Browse repository at this point
Copy the full SHA 8a047b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2431010 - Browse repository at this point
Copy the full SHA 2431010View commit details -
profileCreatedCallback: reduce nesting by checking error state earlier
As a bonus this now handless the unlikely error properly instead of just ignoring it silently.
Configuration menu - View commit details
-
Copy full SHA for 8435e8e - Browse repository at this point
Copy the full SHA 8435e8eView commit details -
profileCreatedCallback: reduce nesting by making the method async
This requires slight changes to addEventListener, but these changes are probably an improvements by themselves.
Configuration menu - View commit details
-
Copy full SHA for 8755f0c - Browse repository at this point
Copy the full SHA 8755f0cView commit details -
profileCreatedCallback: reduce nesting by removing unnecessary check
- Earlier step has checked there's importable mods in the profile - Download provider has another, less user-friendly check for the same thing to prevent the mod profile from getting stuck - It doesn't seem anything catastrophic would happen even if the rest of the code is executed using an empty mod list
Configuration menu - View commit details
-
Copy full SHA for d386f47 - Browse repository at this point
Copy the full SHA d386f47View commit details -
profileCreatedCallback: reduce nesting by removing setTimeout
I don't see any reason for to wrap the code in the timeout. This might have been relevant when the import step was started right away after a new profile was created, by there now exists a preview window between these steps so the folder should always exists. If it doesn't, the 100ms wait won't change things.
Configuration menu - View commit details
-
Copy full SHA for 444fdf6 - Browse repository at this point
Copy the full SHA 444fdf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for adac1f5 - Browse repository at this point
Copy the full SHA adac1f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 612d010 - Browse repository at this point
Copy the full SHA 612d010View commit details