|
@@ -119,12 +119,22 @@ function _initSettings(featureState) {
|
119
|
119
|
let settings = featureState;
|
120
|
120
|
|
121
|
121
|
// Old Settings.js values
|
122
|
|
- // FIXME: Let's remove this after a predefined time (e.g. by July 2018) to
|
123
|
|
- // avoid garbage in the source.
|
124
|
|
- const displayName = _.escape(window.localStorage.getItem('displayname'));
|
125
|
|
- const email = _.escape(window.localStorage.getItem('email'));
|
|
122
|
+ // FIXME: jibri uses old settings.js local storage values to set its display
|
|
123
|
+ // name and email. Provide another way for jibri to set these values, update
|
|
124
|
+ // jibri, and remove the old settings.js values.
|
|
125
|
+ const savedDisplayName = window.localStorage.getItem('displayname');
|
|
126
|
+ const savedEmail = window.localStorage.getItem('email');
|
126
|
127
|
let avatarID = _.escape(window.localStorage.getItem('avatarId'));
|
127
|
128
|
|
|
129
|
+ // The helper _.escape will convert null to an empty strings. The empty
|
|
130
|
+ // string will be saved in settings. On app re-load, because an empty string
|
|
131
|
+ // is a defined value, it will override any value found in local storage.
|
|
132
|
+ // The workaround is sidestepping _.escape when the value is not set in
|
|
133
|
+ // local storage.
|
|
134
|
+ const displayName
|
|
135
|
+ = savedDisplayName === null ? undefined : _.escape(savedDisplayName);
|
|
136
|
+ const email = savedEmail === null ? undefined : _.escape(savedEmail);
|
|
137
|
+
|
128
|
138
|
if (!avatarID) {
|
129
|
139
|
// if there is no avatar id, we generate a unique one and use it forever
|
130
|
140
|
avatarID = randomHexString(32);
|