fix: accented room name display
This commit is contained in:
parent
97735ff548
commit
a46fd60788
|
@ -164,7 +164,7 @@ export function getConferenceName(stateful: Function | Object): string {
|
||||||
|| subject
|
|| subject
|
||||||
|| callDisplayName
|
|| callDisplayName
|
||||||
|| (callee && callee.name)
|
|| (callee && callee.name)
|
||||||
|| _.startCase(safeDecodeURIComponent(room));
|
|| safeStartCase(safeDecodeURIComponent(room));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -351,3 +351,19 @@ export function sendLocalParticipant(
|
||||||
|
|
||||||
conference.setDisplayName(name);
|
conference.setDisplayName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A safe implementation of lodash#startCase that doesn't deburr the string.
|
||||||
|
*
|
||||||
|
* NOTE: According to lodash roadmap, lodash v5 will have this function.
|
||||||
|
*
|
||||||
|
* Code based on https://github.com/lodash/lodash/blob/master/startCase.js.
|
||||||
|
*
|
||||||
|
* @param {string} s - The string to do start case on.
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
function safeStartCase(s = '') {
|
||||||
|
return _.words(`${s}`.replace(/['\u2019]/g, '')).reduce(
|
||||||
|
(result, word, index) => result + (index ? ' ' : '') + _.upperFirst(word)
|
||||||
|
, '');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue