Skip to content
Snippets Groups Projects
Commit bf6ca8ef authored by dakkar's avatar dakkar
Browse files

also ignore stale *failed* responses - #741

since `misskeyApi` doesn't pass us the request, we close over a copy
of the username we requested, to make sure it still matches the
current username value
parent 5af38db7
No related branches found
No related tags found
No related merge requests found
......@@ -107,14 +107,17 @@ const props = withDefaults(defineProps<{
});
function onUsernameChange(): void {
const usernameRequested = username.value;
misskeyApi('users/show', {
username: username.value,
username: usernameRequested,
}).then(userResponse => {
if (userResponse.username === username.value) {
user.value = userResponse;
}
}, () => {
user.value = null;
if (usernameRequested === username.value) {
user.value = null;
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment