diff options
Diffstat (limited to 'src/main/assets')
-rw-r--r-- | src/main/assets/scripts.js | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/src/main/assets/scripts.js b/src/main/assets/scripts.js index bf74cfb5..b204766d 100644 --- a/src/main/assets/scripts.js +++ b/src/main/assets/scripts.js @@ -512,29 +512,22 @@ function addTag(tag) { return false; } -var users = {}; - function fetchUserUri(dataUri, callback) { - if (users[dataUri]) { - callback(users[dataUri]); - } else { - let data = new FormData(); - data.append('uri', dataUri); - fetch('/u/', { - method: 'POST', - body: data - }).then(handleErrors) - .then(response => { - return response.json(); - }) - .then(json => { - users[dataUri] = json; - callback(json); - }) - .catch(e => { - callback({ preferredUsername: dataUri }); - }); - } + let data = new FormData(); + data.append('uri', dataUri); + fetch('/api/u/', { + method: 'POST', + body: data + }).then(handleErrors) + .then(response => { + return response.json(); + }) + .then(json => { + callback(json); + }) + .catch(e => { + callback({ uname: dataUri, uri: dataUri }); + }); } function notificationsCheckPermissions(button) { |