Fix issues introduced in new Typescript version.

This commit is contained in:
Paul
2021-08-30 16:45:23 +01:00
parent dac6f3dbba
commit 4e3e57a7c9
5 changed files with 163 additions and 155 deletions

View File

@@ -316,7 +316,8 @@ export default observer(({ channel }: Props) => {
);
}
} catch (err) {
if (err?.message === "cancel") {
// eslint-disable-next-line
if ((err as any)?.message === "cancel") {
setUploadState({
type: "attached",
files,

View File

@@ -55,7 +55,7 @@ export function OnboardingModal({ onClose, callback }: Props) {
onSubmit={
handleSubmit(
onSubmit,
) as JSX.GenericEventHandler<HTMLFormElement>
) as unknown as JSX.GenericEventHandler<HTMLFormElement>
}>
<div>
<FormField

View File

@@ -326,7 +326,8 @@ export default class VoiceClient extends EventEmitter<VoiceEvents> {
try {
await this.signaling.stopProduce(type);
} catch (error) {
if (error.error === WSErrorCode.ProducerNotFound) return;
// eslint-disable-next-line
if ((error as any).error === WSErrorCode.ProducerNotFound) return;
throw error;
}
}

View File

@@ -152,7 +152,7 @@ export function Form({ page, callback }: Props) {
onSubmit={
handleSubmit(
onSubmit,
) as JSX.GenericEventHandler<HTMLFormElement>
) as unknown as JSX.GenericEventHandler<HTMLFormElement>
}>
{page !== "reset" && (
<FormField