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
This commit is contained in:
@@ -107,14 +107,17 @@ const props = withDefaults(defineProps<{
|
|||||||
});
|
});
|
||||||
|
|
||||||
function onUsernameChange(): void {
|
function onUsernameChange(): void {
|
||||||
|
const usernameRequested = username.value;
|
||||||
misskeyApi('users/show', {
|
misskeyApi('users/show', {
|
||||||
username: username.value,
|
username: usernameRequested,
|
||||||
}).then(userResponse => {
|
}).then(userResponse => {
|
||||||
if (userResponse.username === username.value) {
|
if (userResponse.username === username.value) {
|
||||||
user.value = userResponse;
|
user.value = userResponse;
|
||||||
}
|
}
|
||||||
}, () => {
|
}, () => {
|
||||||
user.value = null;
|
if (usernameRequested === username.value) {
|
||||||
|
user.value = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user