Disables storing display name and email when using overlay ring.

This commit is contained in:
damencho 2016-08-30 14:10:20 -05:00
parent 0e27f471f1
commit 5ab6c551df
2 changed files with 12 additions and 6 deletions

4
app.js
View File

@ -95,9 +95,9 @@ const APP = {
function setTokenData() {
let localUser = APP.tokenData.caller;
if(localUser) {
APP.settings.setEmail((localUser.getEmail() || "").trim());
APP.settings.setEmail((localUser.getEmail() || "").trim(), true);
APP.settings.setAvatarUrl((localUser.getAvatarUrl() || "").trim());
APP.settings.setDisplayName((localUser.getName() || "").trim());
APP.settings.setDisplayName((localUser.getName() || "").trim(), true);
}
}

View File

@ -68,10 +68,13 @@ export default {
* Sets the local user display name and saves it to local storage
*
* @param {string} newDisplayName unescaped display name for the local user
* @param {boolean} disableLocalStore disables local store the display name
*/
setDisplayName (newDisplayName) {
setDisplayName (newDisplayName, disableLocalStore) {
displayName = newDisplayName;
window.localStorage.displayname = UIUtil.escapeHtml(displayName);
if (!disableLocalStore)
window.localStorage.displayname = UIUtil.escapeHtml(displayName);
},
/**
@ -85,10 +88,13 @@ export default {
/**
* Sets new email for local user and saves it to the local storage.
* @param {string} newEmail new email for the local user
* @param {boolean} disableLocalStore disables local store the email
*/
setEmail: function (newEmail) {
setEmail: function (newEmail, disableLocalStore) {
email = newEmail;
window.localStorage.email = UIUtil.escapeHtml(newEmail);
if (!disableLocalStore)
window.localStorage.email = UIUtil.escapeHtml(newEmail);
},
/**