Skip to content

Commit 49008b6

Browse files
committed
remove TypeScript code warnings
1 parent b9405c7 commit 49008b6

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

client/browser/FileSelectDialog.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ function ScrollSpy(props) {
7474
const FilesList = memo((props: any) => {
7575
const {structure, setDirty, selectFile} = props;
7676

77-
console.log('FilesList', structure);
78-
7977
return (
8078
<ul className="files-browser">{
8179
structure.files.length === 0 ?
@@ -255,8 +253,6 @@ const FileSelectDialog = forwardRef((props: any, forwardedRef) => {
255253
props.dialogRef.current.close();
256254
}
257255

258-
console.log('FileSelectDialog', isDirty, structure);
259-
260256
return (<>
261257
<div className="wrapper" ref={ref}>
262258
{uploadedFile ?

client/browser/FinderFileSelect.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ import React, {useEffect, useRef, useState} from 'react';
22
import FileSelectDialog from './FileSelectDialog';
33

44

5+
interface SelectedFile {
6+
id: string;
7+
name: string;
8+
file_name: string;
9+
file_size: number;
10+
sha1: string;
11+
mime_type: string;
12+
last_modified_at: string;
13+
summary: string;
14+
download_url: string;
15+
thumbnail_url: string;
16+
labels: string[];
17+
}
18+
19+
520
export default function FinderFileSelect(props) {
621
const shadowRoot = props.container;
722
const baseUrl = props['base-url'];
@@ -10,7 +25,7 @@ export default function FinderFileSelect(props) {
1025
const selectRef = useRef(null);
1126
const slotRef = useRef(null);
1227
const dialogRef = useRef(null);
13-
const [selectedFile, setSelectedFile] = useState({});
28+
const [selectedFile, setSelectedFile] = useState<SelectedFile>(null);
1429
const csrfToken = getCSRFToken();
1530
const uuid5Regex = new RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
1631

@@ -56,7 +71,7 @@ export default function FinderFileSelect(props) {
5671
async function valueChanged(event) {
5772
const fileId = event.target.value;
5873
if (!uuid5Regex.test(fileId)) {
59-
setSelectedFile({});
74+
setSelectedFile(null);
6075
return;
6176
}
6277
const response = await fetch(`${baseUrl}${fileId}/fetch`);
@@ -104,8 +119,6 @@ export default function FinderFileSelect(props) {
104119
return date.toLocaleString();
105120
}
106121

107-
console.log('FinderFileSelect', selectedFile);
108-
109122
return (<>
110123
<slot ref={slotRef} />
111124
<div className="finder-file-select">

0 commit comments

Comments
 (0)