PERF: Do not wait for debounce call if user identity is cached (#42)

PERF: Do not wait for debounce call if user identity is cached (#42)

diff --git a/assets/javascripts/lib/discourse.js.es6 b/assets/javascripts/lib/discourse.js.es6
index e91f007..8538dc0 100644
--- a/assets/javascripts/lib/discourse.js.es6
+++ b/assets/javascripts/lib/discourse.js.es6
@@ -139,6 +139,10 @@ function _getDebouncedUserIdentity() {
 }
 
 export function getDebouncedUserIdentity(username) {
+  if (userIdentities[username]) {
+    return userIdentities[username];
+  }
+
   return new Promise((resolve, reject) => {
     if (!queuedUsernames[username]) {
       queuedUsernames[username] = [];

GitHub sha: 798a2dd8

This commit appears in #42 which was approved by ZogStriP. It was merged by udan11.