This commit is contained in:
kakkokari-gtyih 2024-10-24 21:29:41 +09:00
parent 0866960342
commit 950c67979a

View file

@ -761,7 +761,8 @@ const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
const raw = await misskeyApi('charts/user/following', { userId: props.args?.user?.id!, limit: props.limit, span: props.span }).catch(() => { const raw = await misskeyApi('charts/user/following', { userId: props.args?.user?.id!, limit: props.limit, span: props.span }).catch(() => {
return null; return null;
}); });
return raw != null ? { if (raw == null) return null;
return {
series: [{ series: [{
name: 'Local', name: 'Local',
type: 'area', type: 'area',
@ -771,14 +772,15 @@ const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
type: 'area', type: 'area',
data: format(raw.remote.followings.total), data: format(raw.remote.followings.total),
}], }],
} : raw; };
}; };
const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => { const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
const raw = await misskeyApi('charts/user/following', { userId: props.args?.user?.id!, limit: props.limit, span: props.span }).catch(() => { const raw = await misskeyApi('charts/user/following', { userId: props.args?.user?.id!, limit: props.limit, span: props.span }).catch(() => {
return null; return null;
}); });
return raw != null ? { if (raw == null) return null;
return {
series: [{ series: [{
name: 'Local', name: 'Local',
type: 'area', type: 'area',
@ -788,7 +790,7 @@ const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
type: 'area', type: 'area',
data: format(raw.remote.followers.total), data: format(raw.remote.followers.total),
}], }],
} : raw; };
}; };
const fetchPerUserDriveChart = async (): Promise<typeof chartData> => { const fetchPerUserDriveChart = async (): Promise<typeof chartData> => {