mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 06:45:11 +00:00
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:
parent
5af38db74b
commit
bf6ca8efdc
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}, () => {
|
||||
if (usernameRequested === username.value) {
|
||||
user.value = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue