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: overwrite numPeers to 1 for solo #333

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

Kodylow
Copy link
Member

@Kodylow Kodylow commented Dec 1, 2023

in case they go back and forth on the role selector.

@Kodylow Kodylow requested a review from a team as a code owner December 1, 2023 17:04
@@ -189,7 +189,7 @@ export const SetConfiguration: React.FC<Props> = ({ next }: Props) => {
myName,
password,
configs: {
numPeers: parseInt(numPeers, 10),
numPeers: isSolo ? 1 : parseInt(numPeers, 10),
Copy link
Collaborator

@wbobeirne wbobeirne Dec 1, 2023

Choose a reason for hiding this comment

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

This might work, but might also be a little buggy since there's also some isSolo consideration up at line 65:

  const [numPeers, setNumPeers] = useState(
    stateNumPeers ? stateNumPeers.toString() : isSolo ? '1' : '4'
  );

We should do this in only one place so they don't get out of sync, either only here and delete the logic up there, or only up there by changing the logic up there to:

isSolo ? '1' : stateNumPeers ? stateNumPeers.toString() : '4'

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

@wbobeirne wbobeirne merged commit b1245ee into fedimint:master Dec 1, 2023
1 check passed
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