merge: ignore stale users/show responses - fixes #741 (!684)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/684

Closes #741

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Hazelnoot 2024-10-12 17:57:39 +00:00
commit 669e5c6ca0

View file

@ -107,12 +107,17 @@ const props = withDefaults(defineProps<{
});
function onUsernameChange(): void {
const usernameRequested = username.value;
misskeyApi('users/show', {
username: username.value,
username: usernameRequested,
}).then(userResponse => {
user.value = userResponse;
if (userResponse.username === username.value) {
user.value = userResponse;
}
}, () => {
user.value = null;
if (usernameRequested === username.value) {
user.value = null;
}
});
}