pl-fe: remove some anys

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-27 17:39:23 +01:00
parent a44dd71be8
commit 59f4138f4f
8 changed files with 7 additions and 8 deletions

View file

@ -90,7 +90,7 @@ const loginWithCode = (code: string) =>
return dispatch(obtainOAuthToken(params, baseURL))
.then((token) => dispatch(authLoggedIn(token)))
.then(({ access_token }) => dispatch(verifyCredentials(access_token as string, baseURL)))
.then(({ access_token }) => dispatch(verifyCredentials(access_token, baseURL)))
.then((account) => dispatch(switchAccount(account.id)))
.then(() => window.location.href = '/');
};

View file

@ -129,7 +129,7 @@ class Visualizer {
draw(cx: number, cy: number, color: string, radius: number, coefficient: number) {
this.context!.save();
const ticks = this.getTicks(parseInt(360 * coefficient as any), this.tickSize, radius, coefficient);
const ticks = this.getTicks(parseInt(String(360 * coefficient)), this.tickSize, radius, coefficient);
ticks.forEach(tick => {
this.drawTick(cx, cy, color, tick.x1, tick.y1, tick.x2, tick.y2);

View file

@ -59,7 +59,7 @@ const AvatarSelectionStep = ({ onNext }: { onNext: () => void }) => {
setSelectedFile(null);
if (error.response?.status === 422) {
toast.error((error.response.json as any).error.replace('Validation failed: ', ''));
toast.error(error.response.json.error.replace('Validation failed: ', ''));
} else {
toast.error(messages.error);
}

View file

@ -40,7 +40,7 @@ const BioStep = ({ onNext }: { onNext: () => void }) => {
setSubmitting(false);
if (error.response?.status === 422) {
setErrors([(error.response.json as any).error.replace('Validation failed: ', '')]);
setErrors([error.response.json.error.replace('Validation failed: ', '')]);
} else {
toast.error(messages.error);
}

View file

@ -63,7 +63,7 @@ const CoverPhotoSelectionStep = ({ onNext }: { onNext: () => void }) => {
setSelectedFile(null);
if (error.response?.status === 422) {
toast.error((error.response.json as any).error.replace('Validation failed: ', ''));
toast.error(error.response.json.error.replace('Validation failed: ', ''));
} else {
toast.error(messages.error);
}

View file

@ -51,7 +51,7 @@ const DisplayNameStep = ({ onNext }: { onNext: () => void }) => {
setSubmitting(false);
if (error.response?.status === 422) {
setErrors([(error.response.json as any).error.replace('Validation failed: ', '')]);
setErrors([error.response.json.error.replace('Validation failed: ', '')]);
} else {
toast.error(messages.error);
}

View file

@ -53,7 +53,7 @@ const SelectedStatus = ({ statusId }: { statusId: string }) => {
return (
<Stack space={2} className='rounded-lg bg-gray-100 p-4 dark:bg-gray-800'>
<AccountContainer
id={status.account as any}
id={status.account?.id}
showAccountHoverCard={false}
withLinkToProfile={false}
timestamp={status.created_at}

View file

@ -147,7 +147,6 @@ const normalizeStatus = (status: BaseStatus & {
media_attachments,
...calculated,
translation: (status.translation || calculated.translation || null) as Translation | null | false,
// quote: status.quote ? normalizeStatus(status.quote as any) : null,
};
};