浏览代码

Disables storing display name and email when using overlay ring.

j8
damencho 9 年前
父节点
当前提交
5ab6c551df
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 2
    2
      app.js
  2. 10
    4
      modules/settings/Settings.js

+ 2
- 2
app.js 查看文件

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

+ 10
- 4
modules/settings/Settings.js 查看文件

@@ -68,10 +68,13 @@ export default {
68 68
      * Sets the local user display name and saves it to local storage
69 69
      *
70 70
      * @param {string} newDisplayName unescaped display name for the local user
71
+     * @param {boolean} disableLocalStore disables local store the display name
71 72
      */
72
-    setDisplayName (newDisplayName) {
73
+    setDisplayName (newDisplayName, disableLocalStore) {
73 74
         displayName = newDisplayName;
74
-        window.localStorage.displayname = UIUtil.escapeHtml(displayName);
75
+
76
+        if (!disableLocalStore)
77
+            window.localStorage.displayname = UIUtil.escapeHtml(displayName);
75 78
     },
76 79
 
77 80
     /**
@@ -85,10 +88,13 @@ export default {
85 88
     /**
86 89
      * Sets new email for local user and saves it to the local storage.
87 90
      * @param {string} newEmail new email for the local user
91
+     * @param {boolean} disableLocalStore disables local store the email
88 92
      */
89
-    setEmail: function (newEmail) {
93
+    setEmail: function (newEmail, disableLocalStore) {
90 94
         email = newEmail;
91
-        window.localStorage.email = UIUtil.escapeHtml(newEmail);
95
+
96
+        if (!disableLocalStore)
97
+            window.localStorage.email = UIUtil.escapeHtml(newEmail);
92 98
     },
93 99
 
94 100
     /**

正在加载...
取消
保存