Adds avatarId to Settings.
This commit is contained in:
parent
5ab6c551df
commit
3852b34397
|
@ -3,6 +3,7 @@
|
||||||
import UIUtil from '../UI/util/UIUtil';
|
import UIUtil from '../UI/util/UIUtil';
|
||||||
|
|
||||||
let email = '';
|
let email = '';
|
||||||
|
let avatarId = '';
|
||||||
let displayName = '';
|
let displayName = '';
|
||||||
let language = null;
|
let language = null;
|
||||||
let cameraDeviceId = '';
|
let cameraDeviceId = '';
|
||||||
|
@ -35,6 +36,13 @@ if (supportsLocalStorage()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
email = UIUtil.unescapeHtml(window.localStorage.email || '');
|
email = UIUtil.unescapeHtml(window.localStorage.email || '');
|
||||||
|
avatarId = UIUtil.unescapeHtml(window.localStorage.avatarId || '');
|
||||||
|
if (!avatarId) {
|
||||||
|
// if there is no avatar id, we generate a unique one and use it forever
|
||||||
|
avatarId = generateUniqueId();
|
||||||
|
window.localStorage.avatarId = avatarId;
|
||||||
|
}
|
||||||
|
|
||||||
localFlipX = JSON.parse(window.localStorage.localFlipX || true);
|
localFlipX = JSON.parse(window.localStorage.localFlipX || true);
|
||||||
displayName = UIUtil.unescapeHtml(window.localStorage.displayname || '');
|
displayName = UIUtil.unescapeHtml(window.localStorage.displayname || '');
|
||||||
language = window.localStorage.language;
|
language = window.localStorage.language;
|
||||||
|
@ -105,6 +113,14 @@ export default {
|
||||||
return email;
|
return email;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns avatar id of the local user.
|
||||||
|
* @returns {string} avatar id
|
||||||
|
*/
|
||||||
|
getAvatarId: function () {
|
||||||
|
return avatarId;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets new avatarUrl for local user and saves it to the local storage.
|
* Sets new avatarUrl for local user and saves it to the local storage.
|
||||||
* @param {string} newAvatarUrl new avatarUrl for the local user
|
* @param {string} newAvatarUrl new avatarUrl for the local user
|
||||||
|
|
Loading…
Reference in New Issue