diff --git a/src/@types/react-navigation.d.ts b/src/@types/react-navigation.d.ts index 58d7b2f1..33834f60 100644 --- a/src/@types/react-navigation.d.ts +++ b/src/@types/react-navigation.d.ts @@ -60,7 +60,6 @@ declare namespace Nav { url: Mastodon.AttachmentImage['url'] width?: number height?: number - preview_url: Mastodon.AttachmentImage['preview_url'] remote_url?: Mastodon.AttachmentImage['remote_url'] }[] id: Mastodon.Attachment['id'] diff --git a/src/api/instance.ts b/src/api/instance.ts index 5bfd48c8..d64457c5 100644 --- a/src/api/instance.ts +++ b/src/api/instance.ts @@ -1,5 +1,5 @@ import { RootState } from '@root/store' -import axios from 'axios' +import axios, { AxiosRequestConfig } from 'axios' import chalk from 'chalk' import li from 'li' @@ -14,7 +14,10 @@ export type Params = { } headers?: { [key: string]: string } body?: FormData - onUploadProgress?: (progressEvent: any) => void + extras?: Omit< + AxiosRequestConfig, + 'method' | 'url' | 'params' | 'headers' | 'data' + > } const apiInstance = async ({ @@ -24,7 +27,7 @@ const apiInstance = async ({ params, headers, body, - onUploadProgress + extras }: Params): Promise<{ body: T; links: { prev?: string; next?: string } }> => { const { store } = require('@root/store') const state = store.getState() as RootState @@ -70,7 +73,7 @@ const apiInstance = async ({ }) }, ...(body && { data: body }), - ...(onUploadProgress && { onUploadProgress: onUploadProgress }) + ...extras }) .then(response => { let prev diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index f7da33b2..04ad5270 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -102,7 +102,11 @@ const GracefullyImage = React.memo( return (