diff --git a/app.js b/app.js index 155d941c7..895508e01 100644 --- a/app.js +++ b/app.js @@ -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); } } diff --git a/modules/settings/Settings.js b/modules/settings/Settings.js index ce9a2d6fc..ebd7ab52a 100644 --- a/modules/settings/Settings.js +++ b/modules/settings/Settings.js @@ -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); }, /**