Skip to content

Conversation

anttimaki
Copy link
Collaborator

No description provided.

Some of the method names weren't very good to start with, and others
no longer fit the functionality after the recent refactoring.
- Don't handle errors here, let them flow to call site instead
- Reduce looping by gathering list of disabled mods separately
- Change the method to accept ImmutableProfile as a parameter to
  separate it from the UI component state
- Move the method to ProfileUtils as a standalone function
- Include installModAfterDownload functionality in installModsToProfile
  as the former is no longer needed
Use ImmutableProfile for installing the mods. Especially when updating
an existing profile this saves us from switching between the temporary
and target profiles.

Active profile is now only updated if the import process finishes
successfully.
Download provider will now handle only the downloading, as fitting its
moniker. Casting one type of object presenting a mod to another type
is done in a separate helper function. This will eventually reduce the
number of arguments passed around between different functions.
- Move parts of profileCreatedCallback to ProfileUtils
- Absorp the functionality from downloadAndSaveMods directly into
  profileCreatedCallback, as the method has been greatly reduced in
  size by previous refactoring, and the readability of the code no
  longer warrants this separation
- As far as I'm concerned, the refactoring of this particular method
  is now completed: all that remains in the method is reading and
  updating the state of the component and the app, and all business
  logic has been moved behind three external methods. While the three
  could be combined into one, it would IMO then become too big of a
  function
- Rename the method to importProfile, since it's not really a callback
  function
Base automatically changed from callbackless-downloadImportedProfileMods to develop October 14, 2024 12:00
@anttimaki anttimaki merged commit 907bdba into develop Oct 14, 2024
5 checks passed
@anttimaki anttimaki deleted the importprofilemodal-refactor-pt518 branch October 14, 2024 12:00
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.

2 participants