Migrate to external library for interacting with API

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-08-06 19:52:36 +02:00
parent 3b87810f85
commit 32c68a9221
89 changed files with 364 additions and 710 deletions

View File

@ -104,7 +104,7 @@ const EventHeader: React.FC<IEventHeader> = ({ status }) => {
};
const handleExportClick = () => {
dispatch(fetchEventIcs(status.id)).then(({ data }) => {
dispatch(fetchEventIcs(status.id)).then((data) => {
download(data, 'calendar.ics');
}).catch(() => {});
};
@ -152,7 +152,7 @@ const EventHeader: React.FC<IEventHeader> = ({ status }) => {
const handleChatClick = () => {
getOrCreateChatByAccountId(account.id)
.then(({ json: chat }) => history.push(`/chats/${chat.id}`))
.then((chat) => history.push(`/chats/${chat.id}`))
.catch(() => {});
};

View File

@ -147,7 +147,7 @@ const EventInformation: React.FC<IEventInformation> = ({ params }) => {
}, [status]);
const renderLinks = useCallback(() => {
if (!status.event?.links.size) return null;
if (!status.event?.links?.size) return null;
return (
<Stack space={1}>
@ -189,7 +189,7 @@ const EventInformation: React.FC<IEventInformation> = ({ params }) => {
<StatusMedia status={status} />
{status.quote && status.pleroma.get('quote_visible', true) && (
{status.quote && (status.quote_visible ?? true) && (
<QuotedStatus statusId={status.quote as string} />
)}