Переглянути джерело

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
 function setTokenData() {
95
 function setTokenData() {
96
     let localUser = APP.tokenData.caller;
96
     let localUser = APP.tokenData.caller;
97
     if(localUser) {
97
     if(localUser) {
98
-        APP.settings.setEmail((localUser.getEmail() || "").trim());
98
+        APP.settings.setEmail((localUser.getEmail() || "").trim(), true);
99
         APP.settings.setAvatarUrl((localUser.getAvatarUrl() || "").trim());
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
      * Sets the local user display name and saves it to local storage
68
      * Sets the local user display name and saves it to local storage
69
      *
69
      *
70
      * @param {string} newDisplayName unescaped display name for the local user
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
         displayName = newDisplayName;
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
     /**
88
     /**
86
      * Sets new email for local user and saves it to the local storage.
89
      * Sets new email for local user and saves it to the local storage.
87
      * @param {string} newEmail new email for the local user
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
         email = newEmail;
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
     /**

Завантаження…
Відмінити
Зберегти