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) => { const exportBlocks = () => (_dispatch: AppDispatch, getState: () => RootState) =>
return getClient(getState()).filtering.getBlocks({ limit: 40 }) getClient(getState()).filtering.getBlocks({ limit: 40 })
.then(listAccounts) .then(listAccounts)
.then((blocks) => { .then((blocks) => {
fileExport(blocks.join('\n'), 'export_block.csv'); fileExport(blocks.join('\n'), 'export_block.csv');
toast.success(messages.blocksSuccess); toast.success(messages.blocksSuccess);
}); });
};
const exportMutes = () => (_dispatch: AppDispatch, getState: () => RootState) => { const exportMutes = () => (_dispatch: AppDispatch, getState: () => RootState) =>
return getClient(getState()).filtering.getMutes({ limit: 40 }) getClient(getState()).filtering.getMutes({ limit: 40 })
.then(listAccounts) .then(listAccounts)
.then((mutes) => { .then((mutes) => {
fileExport(mutes.join('\n'), 'export_mutes.csv'); fileExport(mutes.join('\n'), 'export_mutes.csv');
toast.success(messages.mutesSuccess); toast.success(messages.mutesSuccess);
}); });
};
export { export {
exportFollows, exportFollows,

View file

@ -328,6 +328,9 @@ const Thread: React.FC<IThread> = ({
const focusedStatus = ( const focusedStatus = (
<div className={clsx({ 'pb-4': hasDescendants })} key={status.id}> <div className={clsx({ 'pb-4': hasDescendants })} key={status.id}>
{status.deleted ? (
<Tombstone id={status.id} onMoveUp={handleMoveUp} onMoveDown={handleMoveDown} />
) : (
<HotKeys handlers={handlers}> <HotKeys handlers={handlers}>
<div <div
ref={statusRef} ref={statusRef}
@ -353,6 +356,7 @@ const Thread: React.FC<IThread> = ({
/> />
</div> </div>
</HotKeys> </HotKeys>
)}
{hasDescendants && ( {hasDescendants && (
<hr className='-mx-4 mt-2 max-w-[100vw] border-t-2 black:border-t dark:border-gray-800' /> <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); .catch(() => null);
const createChatMessage = useMutation({ const createChatMessage = useMutation({
mutationFn: ({ chatId, content, mediaId }: { chatId: string; content: string; mediaId?: string }) => { mutationFn: ({ chatId, content, mediaId }: { chatId: string; content: string; mediaId?: string }) =>
return client.chats.createChatMessage(chatId, { content, media_id: mediaId }); client.chats.createChatMessage(chatId, { content, media_id: mediaId }),
},
retry: false, retry: false,
onMutate: async (variables) => { onMutate: async (variables) => {
// Cancel any outgoing refetches (so they don't overwrite our optimistic update) // Cancel any outgoing refetches (so they don't overwrite our optimistic update)

View file

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