diff --git a/packages/frontend/src/components/MkChart.vue b/packages/frontend/src/components/MkChart.vue index cbe08b977b..2302e6c16a 100644 --- a/packages/frontend/src/components/MkChart.vue +++ b/packages/frontend/src/components/MkChart.vue @@ -761,7 +761,8 @@ const fetchPerUserFollowingChart = async (): Promise => { const raw = await misskeyApi('charts/user/following', { userId: props.args?.user?.id!, limit: props.limit, span: props.span }).catch(() => { return null; }); - return raw != null ? { + if (raw == null) return null; + return { series: [{ name: 'Local', type: 'area', @@ -771,14 +772,15 @@ const fetchPerUserFollowingChart = async (): Promise => { type: 'area', data: format(raw.remote.followings.total), }], - } : raw; + }; }; const fetchPerUserFollowersChart = async (): Promise => { const raw = await misskeyApi('charts/user/following', { userId: props.args?.user?.id!, limit: props.limit, span: props.span }).catch(() => { return null; }); - return raw != null ? { + if (raw == null) return null; + return { series: [{ name: 'Local', type: 'area', @@ -788,7 +790,7 @@ const fetchPerUserFollowersChart = async (): Promise => { type: 'area', data: format(raw.remote.followers.total), }], - } : raw; + }; }; const fetchPerUserDriveChart = async (): Promise => {