chore: cleanup

This commit is contained in:
Tom Moor
2022-04-30 08:24:58 -07:00
parent 677ca10b2b
commit a736022c39
10 changed files with 22 additions and 23 deletions

View File

@@ -241,8 +241,8 @@ function MultiplayerEditor({ onSynced, ...props }: Props, ref: any) {
// we must prevent the user from continuing to edit as their changes will not
// be persisted. See: https://github.com/yjs/yjs/issues/303
React.useEffect(() => {
function onUnhandledError(err: any) {
if (err.message.includes("URIError: URI malformed")) {
function onUnhandledError(event: ErrorEvent) {
if (event.message.includes("URIError: URI malformed")) {
showToast(
t(
"Sorry, the last change could not be persisted please reload the page"

View File

@@ -223,7 +223,7 @@ function Invite({ onSubmit }: Props) {
required={!!invite.email}
/>
<InputSelectRole
onChange={(role: any) => handleRoleChange(role as Role, index)}
onChange={(role: Role) => handleRoleChange(role, index)}
value={invite.role}
labelHidden={index !== 0}
short

View File

@@ -14,8 +14,6 @@ import withStores from "~/components/withStores";
import { compressImage } from "~/utils/compressImage";
import { uploadFile, dataUrlToBlob } from "~/utils/files";
const EMPTY_OBJECT = {};
export type Props = {
onSuccess: (url: string) => void | Promise<void>;
onError: (error: string) => void;
@@ -84,7 +82,7 @@ class ImageUpload extends React.Component<RootStore & Props> {
this.isCropping = false;
};
handleZoom = (event: React.DragEvent<any>) => {
handleZoom = (event: React.ChangeEvent<HTMLInputElement>) => {
const target = event.target;
if (target instanceof HTMLInputElement) {
@@ -119,7 +117,6 @@ class ImageUpload extends React.Component<RootStore & Props> {
max="2"
step="0.01"
defaultValue="1"
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
onChange={this.handleZoom}
/>
<CropButton onClick={this.handleCrop} disabled={this.isUploading}>
@@ -139,9 +136,6 @@ class ImageUpload extends React.Component<RootStore & Props> {
<Dropzone
accept="image/png, image/jpeg"
onDropAccepted={this.onDropAccepted}
// @ts-expect-error ts-migrate(2322) FIXME: Type '{ children: ({ getRootProps, getInputProps }... Remove this comment to see the full error message
style={EMPTY_OBJECT}
disablePreview
>
{({ getRootProps, getInputProps }) => (
<div {...getRootProps()}>