From 29f5d87d77a6babb7eb41e69205bbaf694c77c7a Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Wed, 10 Mar 2021 13:36:32 -0600 Subject: [PATCH] fix(prejoin): Don't overwrite display name with '' --- react/features/base/jwt/functions.js | 2 +- react/features/base/settings/middleware.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/react/features/base/jwt/functions.js b/react/features/base/jwt/functions.js index 54fe75030..1d398c85a 100644 --- a/react/features/base/jwt/functions.js +++ b/react/features/base/jwt/functions.js @@ -24,5 +24,5 @@ export function parseJWTFromURLParams(url: URL = window.location) { export function getJwtName(state: Object) { const { user } = state['features/base/jwt']; - return user?.name || ''; + return user?.name; } diff --git a/react/features/base/settings/middleware.js b/react/features/base/settings/middleware.js index 90bcd6593..89c90b774 100644 --- a/react/features/base/settings/middleware.js +++ b/react/features/base/settings/middleware.js @@ -135,9 +135,11 @@ function _maybeUpdateDisplayName({ dispatch, getState }) { if (hasJwt) { const displayName = getJwtName(state); - dispatch(updateSettings({ - displayName - })); + if (displayName) { + dispatch(updateSettings({ + displayName + })); + } } }