subject: avoid sending an extra empty subject update

When setSubject is called too early we store it as pensing, but thanks to the
default parameter value, if undefined is passed to the function we'll store the
empty string.

This will trigger a needless update because undefined !== ''.
This commit is contained in:
Saúl Ibarra Corretgé 2020-06-18 09:56:42 +02:00 committed by Saúl Ibarra Corretgé
parent eed57e7999
commit f230fd4d04
1 changed files with 2 additions and 2 deletions

View File

@ -763,12 +763,12 @@ export function setStartMutedPolicy(
* @param {string} subject - The new subject.
* @returns {void}
*/
export function setSubject(subject: string = '') {
export function setSubject(subject: string) {
return (dispatch: Dispatch<any>, getState: Function) => {
const { conference } = getState()['features/base/conference'];
if (conference) {
conference.setSubject(subject);
conference.setSubject(subject || '');
} else {
dispatch({
type: SET_PENDING_SUBJECT_CHANGE,