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

interface for updating peer name #6

Open
choxi opened this issue Jun 20, 2017 · 0 comments
Open

interface for updating peer name #6

choxi opened this issue Jun 20, 2017 · 0 comments

Comments

@choxi
Copy link
Collaborator

choxi commented Jun 20, 2017

In Trellis, we're doing this to update our user's peer name:

  updatePeerName(value) {
    aMPL.config.name = value
    localStorage.setItem("peerName", value)

    // Force network reconnect
    this.props.store.dispatch({
      type: "OPEN_DOCUMENT",
      file: this.props.store.save()
    })
  }

It sets the shared config on aMPL, and then re-opens the current document as a hacky way of getting the network to reconnect and update all of our listeners in the omniview sidebar. It works for now, but something breaks if you change your peer name too many times too quickly.

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

No branches or pull requests

1 participant