瀏覽代碼

fix(prejoin): Don't overwrite display name with ''

master
Hristo Terezov 4 年之前
父節點
當前提交
29f5d87d77
共有 2 個檔案被更改,包括 6 行新增4 行删除
  1. 1
    1
      react/features/base/jwt/functions.js
  2. 5
    3
      react/features/base/settings/middleware.js

+ 1
- 1
react/features/base/jwt/functions.js 查看文件

24
 export function getJwtName(state: Object) {
24
 export function getJwtName(state: Object) {
25
     const { user } = state['features/base/jwt'];
25
     const { user } = state['features/base/jwt'];
26
 
26
 
27
-    return user?.name || '';
27
+    return user?.name;
28
 }
28
 }

+ 5
- 3
react/features/base/settings/middleware.js 查看文件

135
     if (hasJwt) {
135
     if (hasJwt) {
136
         const displayName = getJwtName(state);
136
         const displayName = getJwtName(state);
137
 
137
 
138
-        dispatch(updateSettings({
139
-            displayName
140
-        }));
138
+        if (displayName) {
139
+            dispatch(updateSettings({
140
+                displayName
141
+            }));
142
+        }
141
     }
143
     }
142
 }
144
 }
143
 
145
 

Loading…
取消
儲存