@@ -4,7 +4,6 @@ import { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/exter
4
4
import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled' ;
5
5
import type { SystemStyleObject } from '@invoke-ai/ui-library' ;
6
6
import { Box , Flex , Heading } from '@invoke-ai/ui-library' ;
7
- import { logger } from 'app/logging/logger' ;
8
7
import { getStore } from 'app/store/nanostores/store' ;
9
8
import { useAppSelector } from 'app/store/storeHooks' ;
10
9
import { DndDropOverlay } from 'features/dnd/DndDropOverlay' ;
@@ -22,8 +21,6 @@ import { z } from 'zod';
22
21
const ACCEPTED_IMAGE_TYPES = [ 'image/png' , 'image/jpg' , 'image/jpeg' ] ;
23
22
const ACCEPTED_FILE_EXTENSIONS = [ '.png' , '.jpg' , '.jpeg' ] ;
24
23
25
- const log = logger ( 'generation' ) ;
26
-
27
24
// const MAX_IMAGE_SIZE = 4; //In MegaBytes
28
25
// const sizeInMB = (sizeInBytes: number, decimalsNum = 2) => {
29
26
// const result = sizeInBytes / (1024 * 1024);
@@ -77,11 +74,9 @@ export const FullscreenDropzone = memo(() => {
77
74
78
75
const validateAndUploadFiles = useCallback (
79
76
( files : File [ ] ) => {
80
- log . info ( 'validateAndUploadFiles' ) ;
81
77
const { getState } = getStore ( ) ;
82
78
const uploadFilesSchema = getFilesSchema ( maxImageUploadCount ) ;
83
79
const parseResult = uploadFilesSchema . safeParse ( files ) ;
84
- log . info ( 'parseResult' ) ;
85
80
86
81
if ( ! parseResult . success ) {
87
82
const description =
@@ -114,10 +109,7 @@ export const FullscreenDropzone = memo(() => {
114
109
115
110
const onPaste = useCallback (
116
111
( e : ClipboardEvent ) => {
117
- log . info ( 'in paste' ) ;
118
- log . info ( `clipboardData: ${ JSON . stringify ( e . clipboardData ) } ` ) ;
119
112
if ( ! e . clipboardData ?. files ) {
120
- log . info ( 'no files' ) ;
121
113
return ;
122
114
}
123
115
const files = Array . from ( e . clipboardData . files ) ;
@@ -162,18 +154,10 @@ export const FullscreenDropzone = memo(() => {
162
154
} , [ validateAndUploadFiles ] ) ;
163
155
164
156
useEffect ( ( ) => {
165
- log . info ( 'use effect' ) ;
166
- // const controller = new AbortController();
167
- try {
168
- window . addEventListener ( 'paste' , onPaste ) ;
169
- } catch ( error ) {
170
- log . info ( `error: ${ JSON . stringify ( error ) } ` ) ;
171
- }
157
+ window . addEventListener ( 'paste' , onPaste ) ;
172
158
173
159
return ( ) => {
174
- log . info ( 'abort' ) ;
175
160
window . removeEventListener ( 'paste' , onPaste ) ;
176
- // controller.abort();
177
161
} ;
178
162
} , [ onPaste ] ) ;
179
163
0 commit comments