Skip to content

Commit 7fb06f7

Browse files
committed
fix mounted drive check
1 parent 2072279 commit 7fb06f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

jupyter_drives/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def list_drives(self):
8888
"name": result.name,
8989
"region": self._config.region_name if self._config.region_name is not None else "eu-north-1",
9090
"creation_date": result.extra["creation_date"],
91-
"mounted": "true" if result.name not in self._content_managers else "false",
91+
"mounted": False if result.name not in self._content_managers else True,
9292
"provider": self._config.provider
9393
}
9494
)

src/contents.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,17 @@ export class Drive implements Contents.IDrive {
192192
}
193193

194194
// extract current drive name
195-
const currentDrive = this.drivesList.filter(x => x.name === localPath)[0];
195+
const currentDrive = this._drivesList.filter(
196+
x => x.name === localPath
197+
)[0];
196198
// when accessed the first time, mount drive
197-
if (!currentDrive.mounted) {
199+
if (currentDrive.mounted === false) {
198200
try {
199201
await mountDrive(localPath, {
200202
provider: currentDrive.provider,
201203
region: currentDrive.region
202204
});
203-
currentDrive.mounted = true;
205+
this._drivesList.filter(x => x.name === localPath)[0].mounted = true;
204206
} catch (e) {
205207
console.log(e);
206208
}

0 commit comments

Comments
 (0)