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
#8131 Auto-deactivate unassigned mods on Mods Page #8164
Conversation
…nentsAndSaveState
…ix/7475_fix_switch_deployed_mod
deployments: deactivatedModComponents.map( | ||
(modComponent) => modComponent._deployment.id, | ||
), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also mirrors logic in deploymentUpdater, see deactivateUnassignedDeployments. It's tricky to extract and share this logic with the current architecture because the deploymentUpdater can't dispatch redux actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deploymentUpdater can't dispatch redux actions.
Technically you can, you just have to manually call the reducer and use our set the resulting state using setReduxStorage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically you can, you just have to manually call the reducer and use our set the resulting state using setReduxStorage
Right, what I mean is that having to do that makes logic sharing tricky between the background and the react code
I think we're violating SRP here. I would extract it to it's own custom hook. |
extensionUpdateRequired, | ||
}); | ||
|
||
useDeactivateUnassignedDeploymentsEffect(unassignedModComponents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to add to strict null but had to remove due to dependency issues
# Conflicts: # src/extensionConsole/pages/deployments/DeploymentsContext.tsx # src/extensionConsole/pages/deployments/useAutoDeploy.test.ts # src/extensionConsole/pages/deployments/useAutoDeploy.ts # src/utils/deploymentUtils.ts
* add test for deactivating unassigned mods * fix type error
What does this PR do?
Discussion
Demo
Todo
Checklist