From 5ab6c551df4bd665e5a879856abf20e2cf7c2dae Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 30 Aug 2016 14:10:20 -0500 Subject: [PATCH] Disables storing display name and email when using overlay ring. --- app.js | 4 ++-- modules/settings/Settings.js | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) 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); }, /**