diff --git a/client/src/client/services/voice/peers/VoicePeer.jsx b/client/src/client/services/voice/peers/VoicePeer.jsx index dbad3a41f..6741ed86d 100644 --- a/client/src/client/services/voice/peers/VoicePeer.jsx +++ b/client/src/client/services/voice/peers/VoicePeer.jsx @@ -15,7 +15,7 @@ export class VoicePeer { if (options.displayOverride) { // override display name and uuid displayName = options.displayOverride.name || peerName; - displayUuid = options.displayOverride.uuid || peerUuid; + displayUuid = options.displayOverride.displayUuid || peerUuid; } // register in global state @@ -39,6 +39,8 @@ export class VoicePeer { this.peerName = peerName; this.peerUuid = peerUuid; + this.displayName = displayName; + this.displayUuid = displayUuid; this.peerStreamKey = peerStreamKey; this.location = location; this.killed = false; @@ -73,9 +75,17 @@ export class VoicePeer { } } + let { displayUuid, displayName } = this; + + if (changedOptions.displayOverride) { + // override display name and uuid + displayName = changedOptions.displayOverride.name || this.peerName; + displayUuid = changedOptions.displayOverride.displayUuid || this.peerUuid; + } + this.options = changedOptions; // update global state - setGlobalState({ voiceState: { peers: { [this.peerStreamKey]: { options: this.options } } } }); + setGlobalState({ voiceState: { peers: { [this.peerStreamKey]: { options: this.options, displayName, displayUuid } } } }); } updateLocation(x, y, z) {