pl-fe: use tombstone for deleted posts

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk 2024-12-05 14:16:35 +01:00
parent 6d103b8916
commit 9bb2a3a3fe
4 changed files with 34 additions and 34 deletions

View file

@ -51,25 +51,23 @@ const exportFollows = () => async (_dispatch: AppDispatch, getState: () => RootS
});
};
const exportBlocks = () => (_dispatch: AppDispatch, getState: () => RootState) => {
return getClient(getState()).filtering.getBlocks({ limit: 40 })
const exportBlocks = () => (_dispatch: AppDispatch, getState: () => RootState) =>
getClient(getState()).filtering.getBlocks({ limit: 40 })
.then(listAccounts)
.then((blocks) => {
fileExport(blocks.join('\n'), 'export_block.csv');
toast.success(messages.blocksSuccess);
});
};
const exportMutes = () => (_dispatch: AppDispatch, getState: () => RootState) => {
return getClient(getState()).filtering.getMutes({ limit: 40 })
const exportMutes = () => (_dispatch: AppDispatch, getState: () => RootState) =>
getClient(getState()).filtering.getMutes({ limit: 40 })
.then(listAccounts)
.then((mutes) => {
fileExport(mutes.join('\n'), 'export_mutes.csv');
toast.success(messages.mutesSuccess);
});
};
export {
exportFollows,

View file

@ -328,31 +328,35 @@ const Thread: React.FC<IThread> = ({
const focusedStatus = (
<div className={clsx({ 'pb-4': hasDescendants })} key={status.id}>
<HotKeys handlers={handlers}>
<div
ref={statusRef}
className='focusable relative'
tabIndex={0}
// FIXME: no "reblogged by" text is added for the screen reader
aria-label={textForScreenReader(intl, status)}
>
{status.deleted ? (
<Tombstone id={status.id} onMoveUp={handleMoveUp} onMoveDown={handleMoveDown} />
) : (
<HotKeys handlers={handlers}>
<div
ref={statusRef}
className='focusable relative'
tabIndex={0}
// FIXME: no "reblogged by" text is added for the screen reader
aria-label={textForScreenReader(intl, status)}
>
<DetailedStatus
status={status}
withMedia={withMedia}
onOpenCompareHistoryModal={handleOpenCompareHistoryModal}
/>
<DetailedStatus
status={status}
withMedia={withMedia}
onOpenCompareHistoryModal={handleOpenCompareHistoryModal}
/>
<hr className='-mx-4 mb-2 max-w-[100vw] border-t-2 black:border-t dark:border-gray-800' />
<hr className='-mx-4 mb-2 max-w-[100vw] border-t-2 black:border-t dark:border-gray-800' />
<StatusActionBar
status={status}
expandable={isModal}
space='lg'
withLabels
/>
</div>
</HotKeys>
<StatusActionBar
status={status}
expandable={isModal}
space='lg'
withLabels
/>
</div>
</HotKeys>
)}
{hasDescendants && (
<hr className='-mx-4 mt-2 max-w-[100vw] border-t-2 black:border-t dark:border-gray-800' />

View file

@ -153,9 +153,8 @@ const useChatActions = (chatId: string) => {
.catch(() => null);
const createChatMessage = useMutation({
mutationFn: ({ chatId, content, mediaId }: { chatId: string; content: string; mediaId?: string }) => {
return client.chats.createChatMessage(chatId, { content, media_id: mediaId });
},
mutationFn: ({ chatId, content, mediaId }: { chatId: string; content: string; mediaId?: string }) =>
client.chats.createChatMessage(chatId, { content, media_id: mediaId }),
retry: false,
onMutate: async (variables) => {
// Cancel any outgoing refetches (so they don't overwrite our optimistic update)

View file

@ -6,9 +6,8 @@ const useFetchRelationships = () => {
const client = useClient();
return useMutation({
mutationFn: ({ accountIds }: { accountIds: string[]}) => {
return client.accounts.getRelationships(accountIds);
},
mutationFn: ({ accountIds }: { accountIds: string[]}) =>
client.accounts.getRelationships(accountIds),
});
};