@@ -11,7 +11,7 @@ import {makeTestId} from 'app/client/lib/domUtils';
11
11
import { FocusLayer } from 'app/client/lib/FocusLayer' ;
12
12
import { ImportSourceElement } from 'app/client/lib/ImportSourceElement' ;
13
13
import { makeT } from 'app/client/lib/localization' ;
14
- import { fetchURL , isDriveUrl , selectFiles , uploadFiles } from 'app/client/lib/uploads' ;
14
+ import { EXTENSIONS_IMPORTABLE_WITHIN_DOC , fetchURL , isDriveUrl , selectFiles , uploadFiles } from 'app/client/lib/uploads' ;
15
15
import { reportError } from 'app/client/models/AppModel' ;
16
16
import { ColumnRec , ViewFieldRec , ViewSectionRec } from 'app/client/models/DocModel' ;
17
17
import { SortedRowSet } from 'app/client/models/rowset' ;
@@ -202,7 +202,10 @@ export async function importFromFile(gristDoc: GristDoc, createPreview: CreatePr
202
202
let uploadResult : UploadResult | null = null ;
203
203
// Use the built-in file picker. On electron, it uses the native file selector (without
204
204
// actually uploading anything), which is why this requires a slightly different flow.
205
- const files : File [ ] = await openFilePicker ( { multiple : true } ) ;
205
+ const files : File [ ] = await openFilePicker ( {
206
+ multiple : true ,
207
+ accept : EXTENSIONS_IMPORTABLE_WITHIN_DOC . join ( "," ) ,
208
+ } ) ;
206
209
// Important to fork first before trying to import, so we end up uploading to a
207
210
// consistent doc worker.
208
211
await gristDoc . forkIfNeeded ( ) ;
0 commit comments