From d82c0ddba97900e351c1f8f317ae04357f5f8751 Mon Sep 17 00:00:00 2001 From: Hazel K Date: Thu, 3 Oct 2024 12:03:21 -0400 Subject: [PATCH] fix "fetch user info during animation sync" --- .../frontend/src/pages/following-feed.vue | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/frontend/src/pages/following-feed.vue b/packages/frontend/src/pages/following-feed.vue index f023c6affe..17b4f35cde 100644 --- a/packages/frontend/src/pages/following-feed.vue +++ b/packages/frontend/src/pages/following-feed.vue @@ -114,24 +114,25 @@ async function showUserNotes(userId: string): Promise { selectedUser.value = null; if (userId) { - await Promise.all([ - // Wait for 1 second to match the animation effects in MkHorizontalSwipe, MkPullToRefresh, and MkPagination. - // Otherwise, the page appears to load "backwards". - new Promise(resolve => setTimeout(resolve, 1000)), + await Promise + .all([ + // We need a User entity, but the pagination returns only UserLite. + // An additional request is needed to "upgrade" the object. + misskeyApi('users/show', { userId }), - // We need a User entity, but the pagination returns only UserLite. - // An additional request is needed to "upgrade" the object. - misskeyApi('users/show', { userId }) - .then(user => selectedUser.value = user) - .catch(error => { - console.error('Error fetching user info', error); + // Wait for 1 second to match the animation effects in MkHorizontalSwipe, MkPullToRefresh, and MkPagination. + // Otherwise, the page appears to load "backwards". + new Promise(resolve => setTimeout(resolve, 1000)), + ]) + .then(([user]) => selectedUser.value = user) + .catch(error => { + console.error('Error fetching user info', error); - return selectedUserError.value = - typeof(error) === 'string' - ? String(error) - : JSON.stringify(error); - }), - ]); + return selectedUserError.value = + typeof(error) === 'string' + ? String(error) + : JSON.stringify(error); + }); } }