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

Peer.Nick Always Undefined #27

Open
rachel-elas-ai opened this issue Mar 12, 2022 · 0 comments
Open

Peer.Nick Always Undefined #27

rachel-elas-ai opened this issue Mar 12, 2022 · 0 comments

Comments

@rachel-elas-ai
Copy link

rachel-elas-ai commented Mar 12, 2022

The peer.nick value always returns undefined, even though it's present in the Peer object. For instance, I pass a nickname to the Liowebrtc component as shown below:

<LioWebRTC
        options={{ debug: true,
                   dataOnly: true,
                   nick: "Pippin" }}
        onReady={join}
        onCreatedPeer={handleCreatedPeer}
        onReceivedPeerData={handlePeerData}  >

If I print the peer object to console in handleCreatedPeer, I can see peer has a nick with value "Pippin." However, trying to call peer.nick or peer["nick"] always produces undefined.

For instance,

    console.log("Peer id: ", peer.id);  // valid value
    console.log("Peer nick: ", peer.nick);  // undefined
    console.log("Peer one: ", peer.oneway);  // valid value

even though:

image

If I call `Object.keys()` on Peer, I get

image

As you can see, nick is missing, even though it's there when you log the object in its entirety.

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