diff options
| author | zyoshoka <107108195+zyoshoka@users.noreply.github.com> | 2025-05-05 06:04:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-05 06:04:20 +0900 |
| commit | 32d2206832bba0f974b84325781609b11203061c (patch) | |
| tree | dfbc3bce6bd9d3e713073284eeb869b696d2cc0c | |
| parent | docs(changelog): add information for #15924 (#15947) (diff) | |
| download | misskey-32d2206832bba0f974b84325781609b11203061c.tar.gz misskey-32d2206832bba0f974b84325781609b11203061c.tar.bz2 misskey-32d2206832bba0f974b84325781609b11203061c.zip | |
fix(frontend): handle error in user popup (#15948)
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkUserPopup.vue | 16 |
2 files changed, 14 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1924805849..b3655536b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Enhance: タイムラインのパフォーマンスを向上 - Fix: 一部のブラウザでアコーディオンメニューのアニメーションが動作しない問題を修正 - Fix: ダイアログのお知らせが画面からはみ出ることがある問題を修正 +- Fix: ユーザーポップアップでエラーが生じてもインジケーターが表示され続けてしまう問題を修正 ### Server - Enhance: 凍結されたユーザのノートが各種タイムラインで表示されないように `#15775` diff --git a/packages/frontend/src/components/MkUserPopup.vue b/packages/frontend/src/components/MkUserPopup.vue index 3bd2a2ffae..2a423bfa55 100644 --- a/packages/frontend/src/components/MkUserPopup.vue +++ b/packages/frontend/src/components/MkUserPopup.vue @@ -12,7 +12,8 @@ SPDX-License-Identifier: AGPL-3.0-only appear @afterLeave="emit('closed')" > <div v-if="showing" :class="$style.root" class="_popup _shadow" :style="{ zIndex, top: top + 'px', left: left + 'px' }" @mouseover="() => { emit('mouseover'); }" @mouseleave="() => { emit('mouseleave'); }"> - <div v-if="user != null"> + <MkError v-if="error" @retry="fetchUser()"/> + <div v-else-if="user != null"> <div :class="$style.banner" :style="user.bannerUrl ? { backgroundImage: `url(${prefer.s.disableShowingAnimatedImages ? getStaticImageUrl(user.bannerUrl) : user.bannerUrl})` } : ''"> <span v-if="$i && $i.id != user.id && user.isFollowed" :class="$style.followed">{{ i18n.ts.followsYou }}</span> </div> @@ -85,6 +86,7 @@ const zIndex = os.claimZIndex('middle'); const user = ref<Misskey.entities.UserDetailed | null>(null); const top = ref(0); const left = ref(0); +const error = ref(false); function showMenu(ev: MouseEvent) { if (user.value == null) return; @@ -92,19 +94,27 @@ function showMenu(ev: MouseEvent) { os.popupMenu(menu, ev.currentTarget ?? ev.target).finally(cleanup); } -onMounted(() => { +async function fetchUser() { if (typeof props.q === 'object') { user.value = props.q; + error.value = false; } else { - const query = props.q.startsWith('@') ? + const query: Omit<Misskey.entities.UsersShowRequest, 'userIds'> = props.q.startsWith('@') ? Misskey.acct.parse(props.q.substring(1)) : { userId: props.q }; misskeyApi('users/show', query).then(res => { if (!props.showing) return; user.value = res; + error.value = false; + }, () => { + error.value = true; }); } +} + +onMounted(() => { + fetchUser(); const rect = props.source.getBoundingClientRect(); const x = ((rect.left + (props.source.offsetWidth / 2)) - (300 / 2)) + window.scrollX; |