Skip to content

Commit 8b11e32

Browse files
committed
Fix race condition
1 parent 76af245 commit 8b11e32

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/drive.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ export class FileSystemDrive implements Contents.IDrive {
4242
const root = this._rootHandle;
4343

4444
if (!root) {
45-
throw new Error('Files not available');
45+
return {
46+
name: '',
47+
path: '',
48+
created: new Date().toISOString(),
49+
last_modified: new Date().toISOString(),
50+
format: 'json',
51+
content: null,
52+
writable: true,
53+
type: 'directory',
54+
mimetype: 'application/json'
55+
};
4656
}
4757

4858
if (localPath) {

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const plugin: JupyterFrontEndPlugin<void> = {
2727
) => {
2828
if (!window.showDirectoryPicker) {
2929
// bail if the browser does not support the File System API
30-
console.warn('The File System API is not supported in this browser.');
30+
console.warn(
31+
'The File System Access API is not supported in this browser.'
32+
);
3133
return;
3234
}
3335

0 commit comments

Comments
 (0)