瀏覽代碼

fix: accented room name display

j8
Bettenbuk Zoltan 5 年之前
父節點
當前提交
a46fd60788
共有 1 個檔案被更改,包括 17 行新增1 行删除
  1. 17
    1
      react/features/base/conference/functions.js

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

164
         || subject
164
         || subject
165
         || callDisplayName
165
         || callDisplayName
166
         || (callee && callee.name)
166
         || (callee && callee.name)
167
-        || _.startCase(safeDecodeURIComponent(room));
167
+        || safeStartCase(safeDecodeURIComponent(room));
168
 }
168
 }
169
 
169
 
170
 /**
170
 /**
351
 
351
 
352
     conference.setDisplayName(name);
352
     conference.setDisplayName(name);
353
 }
353
 }
354
+
355
+/**
356
+ * A safe implementation of lodash#startCase that doesn't deburr the string.
357
+ *
358
+ * NOTE: According to lodash roadmap, lodash v5 will have this function.
359
+ *
360
+ * Code based on https://github.com/lodash/lodash/blob/master/startCase.js.
361
+ *
362
+ * @param {string} s - The string to do start case on.
363
+ * @returns {string}
364
+ */
365
+function safeStartCase(s = '') {
366
+    return _.words(`${s}`.replace(/['\u2019]/g, '')).reduce(
367
+        (result, word, index) => result + (index ? ' ' : '') + _.upperFirst(word)
368
+        , '');
369
+}

Loading…
取消
儲存