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

Edit hostname not working #63

Closed
aminoz007 opened this issue Jun 29, 2020 · 3 comments · Fixed by #66
Closed

Edit hostname not working #63

aminoz007 opened this issue Jun 29, 2020 · 3 comments · Fixed by #66
Assignees
Labels
bug Something isn't working released

Comments

@aminoz007
Copy link
Contributor

Edit the hostname after adding the status page has no effect.
The function below handles the edit operation, however this will not work because indexOfEditedHostname will be always equal to -1 since hostnameObject.hostname has been modified and no longer equal to the hostname saved in the nerdtorage!

  async editHostName(hostnameObject) {
    const { hostNames } = this.state;
    const { hostName } = hostnameObject;
    const indexOfEditedHostname = hostNames.findIndex(
      val => val.hostName === hostName
    );

    const newHostnameObject = hostnameObject;
    newHostnameObject.id = hostNames[indexOfEditedHostname].id;
    hostNames[indexOfEditedHostname] = newHostnameObject;

    this.setState({ hostNames: hostNames });
    await this.save();
  }
@aminoz007 aminoz007 added the bug Something isn't working label Jun 29, 2020
@norbertsuski
Copy link
Contributor

I'm looking into it

@nr-opensource-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.12.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@nr-opensource-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants