From d3e4d7614842a3964d0ac301a2a69b8c8318298e Mon Sep 17 00:00:00 2001 From: ThinaticSystem Date: Sat, 21 May 2022 06:27:37 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E6=96=B0=E3=81=AE=E6=8A=95=E7=A8=BF?= =?UTF-8?q?=E3=81=8C=E5=8F=96=E5=BE=97=E6=B8=88=E3=81=AE=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E3=81=AE=E5=A0=B4=E5=90=88=E3=81=AF=E3=83=AA?= =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E8=A9=B3=E7=B4=B0=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/notification.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 556df8863..dd5382671 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -60,7 +60,7 @@ - + {{ $ts.youGotNewFollower }}
{{ $ts.followRequestAccepted }} {{ $ts.receiveFollowRequest }}
|
@@ -166,19 +166,23 @@ export default defineComponent({ }, {}, 'closed'); }); - function openRenoteDestination(remoteUser: User): void { - os.api('users/show', {userId: remoteUser.id}).then(user => { + function openRenoteDestination(renoteNotification: misskey.entities.Notification): void { + if (renoteNotification.type !== 'renote') { + throw new Error("openRenoteDestination()の引数には type: 'renote' のNotificationが渡される必要があります"); + } + + os.api('users/show', {userId: renoteNotification.user.id}).then(user => { if (user.host != null && user.followersCount === 0) { // リモートユーザーかつローカルの人間が誰もフォローしていない(最新の投稿が取得できない)ユーザー window.open(user.url, '_blank', 'rel="nofollow noopener"'); } else { - os.pageWindow('/@' + user.username + (user.host ? `@${user.host}` : '')); + os.pageWindow(notePage(renoteNotification.note)); } }); } return { getNoteSummary: (note: misskey.entities.Note) => getNoteSummary(note), - openRenoteDestination: (remoteUser: misskey.entities.User) => openRenoteDestination(remoteUser), + openRenoteDestination: (renoteNotification: misskey.entities.Notification) => openRenoteDestination(renoteNotification), followRequestDone, groupInviteDone, notePage,