nicolium: fix reports modal

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-05 15:52:16 +01:00
parent f4de9a3c6a
commit b66e02a6c9
3 changed files with 22 additions and 11 deletions

View File

@ -565,7 +565,6 @@
"column.search": "Search",
"column.settings_store": "Settings store",
"column.subscribers": "Subscribers",
"column.test": "Test timeline",
"column.tokens": "Active sessions",
"column.wrenched": "Recent wrenches timeline",
"column_forbidden.body": "You do not have permission to access this page.",
@ -804,7 +803,6 @@
"developers.navigation.service_worker_label": "Service Worker",
"developers.navigation.settings_store_label": "Settings store",
"developers.navigation.show_toast": "Trigger Toast",
"developers.navigation.test_timeline_label": "Test timeline",
"developers.settings_store.advanced": "Advanced settings",
"developers.settings_store.hint": "It is possible to directly edit your user settings here. BE CAREFUL! Editing this section can break your account, and you will only be able to recover through the API.",
"direct.search_placeholder": "Send a message to…",
@ -1016,7 +1014,6 @@
"empty_column.scheduled_statuses": "You don't have any scheduled statuses yet. When you add one, it will show up here.",
"empty_column.search.accounts": "There are no people results for \"{term}\"",
"empty_column.search.statuses": "There are no posts results for \"{term}\"",
"empty_column.test": "The test timeline is empty.",
"empty_column.wrenched": "There is nothing here! 🔧 a public post to fill it up",
"event.banner": "Event banner",
"event.copy": "Copy link to event",

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useMemo, useState } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import Button from '@/components/ui/button';
@ -7,9 +7,9 @@ import HStack from '@/components/ui/hstack';
import Stack from '@/components/ui/stack';
import Text from '@/components/ui/text';
import Toggle from '@/components/ui/toggle';
import { useAppSelector } from '@/hooks/use-app-selector';
import { useFeatures } from '@/hooks/use-features';
import StatusCheckBox from '@/modals/report-modal/components/status-check-box';
import { useAccountTimeline } from '@/queries/timelines/use-timelines';
import { getDomain } from '@/utils/accounts';
import type { Account } from 'pl-api';
@ -58,12 +58,21 @@ const OtherActionsStep = ({
const features = useFeatures();
const intl = useIntl();
const statusIds = useAppSelector((state) => [
...new Set([
...state.timelines[`account:${account.id}:with_replies`].items,
...selectedStatusIds,
]),
]);
const { entries } = useAccountTimeline(account.id, { exclude_replies: false });
const statusIds = useMemo(() => {
const timelineStatusIds = entries
.map((entry) =>
entry.type === 'status'
? entry.reblogIds.length > 0
? entry.reblogIds[0]
: entry.id
: null,
)
.filter((id): id is string => id !== null);
return [...new Set([...timelineStatusIds, ...selectedStatusIds])];
}, [entries, selectedStatusIds]);
const isBlocked = block;
const isForward = forward;
const canForward = !account.local && features.federating;

View File

@ -11,6 +11,7 @@ type TimelineEntry =
type: 'status';
id: string;
rebloggedBy: Array<string>;
reblogIds: Array<string>;
isConnectedTop?: boolean;
isConnectedBottom?: boolean;
}
@ -86,12 +87,14 @@ const processPage = (statuses: Array<Status>): Array<TimelineEntry> => {
// entry connection stuff might happen to call processStatus on the same status multiple times
if (!existingEntry.rebloggedBy.includes(status.account.id)) {
existingEntry.rebloggedBy.push(status.account.id);
existingEntry.reblogIds.push(status.id);
}
} else {
timelinePage.push({
type: 'status',
id: status.reblog.id,
rebloggedBy: [status.account.id],
reblogIds: [status.id],
isConnectedTop,
});
}
@ -102,6 +105,7 @@ const processPage = (statuses: Array<Status>): Array<TimelineEntry> => {
type: 'status',
id: status.id,
rebloggedBy: [],
reblogIds: [],
isConnectedTop,
});
@ -230,6 +234,7 @@ const useTimelinesStore = create<State>()(
type: 'status',
id: newId,
rebloggedBy: [],
reblogIds: [],
};
}
}