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: Fix connecting wifi manually bug #685

Merged

Conversation

jane-rose
Copy link
Contributor

No description provided.

@parachvte parachvte added the Type: Bug/Bug Fix A bug fix label Jan 7, 2021
@jane-rose
Copy link
Contributor Author

Fixes #640

Copy link
Contributor

@parachvte parachvte left a comment

Choose a reason for hiding this comment

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

inappropriate logic implement, changes needed.

@@ -192,6 +193,7 @@ class WifiConnection extends PureComponent {

this.props.setManualIP(text);
const server = new Server('Manual', text);
this.props.addSelectedServerToList(server);
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that we only support one single manual server (cause we only save one).
So everytime we call setSelectedServer(), the server must be added to server list.

=> addSelectedServerToList() action is not necessary, the logic can be put inside of setSelectedServer().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, i konw think so.

@@ -41,6 +41,22 @@ const setSelectedServer = (server) => (dispatch) => {
dispatch(baseActions.updateState({ server }));
};

const addSelectedServerToList = (server) => (dispatch, getState) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The action will cause only server present in servers, but what we need is prepend selected server to server list, not replacing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that's make sense

@jane-rose jane-rose force-pushed the fix-connecting-wifi-manually-bug branch from f9c900a to c727a03 Compare January 8, 2021 03:19
@parachvte parachvte merged commit abce57e into Snapmaker:master Jan 8, 2021
@jane-rose jane-rose deleted the fix-connecting-wifi-manually-bug branch January 12, 2021 08:29
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