@@ -60,9 +60,7 @@ export class Drive implements Contents.IDrive {
60
60
this . _region = region ! ;
61
61
} ) ;
62
62
}
63
- this . formatRoot ( root ?? '' ) . then ( ( root : string ) => {
64
- this . _root = root ;
65
- } ) ;
63
+ this . _root = root ;
66
64
this . _registeredFileTypes = { } ;
67
65
}
68
66
@@ -130,6 +128,20 @@ export class Drive implements Contents.IDrive {
130
128
this . formatRoot ( root ?? '' ) . then ( root => ( this . _root = root ) ) ;
131
129
}
132
130
131
+ /**
132
+ * Get the formatted root checker.
133
+ */
134
+ get isRootFormatted ( ) : boolean {
135
+ return this . _isRootFormatted ;
136
+ }
137
+
138
+ /**
139
+ * Set the formatted root checker.
140
+ */
141
+ set isRootFormatted ( isRootFormatted ) {
142
+ this . _isRootFormatted = isRootFormatted ;
143
+ }
144
+
133
145
/**
134
146
* The Drive provider getter
135
147
*/
@@ -257,6 +269,14 @@ export class Drive implements Contents.IDrive {
257
269
) : Promise < Contents . IModel > {
258
270
path = path . replace ( this . _name + '/' , '' ) ;
259
271
272
+ // format root the first time this gets called
273
+ if ( ! this . _isRootFormatted ) {
274
+ this . formatRoot ( this . _root ?? '' ) . then ( ( root : string ) => {
275
+ this . _root = root ;
276
+ } ) ;
277
+ this . _isRootFormatted = true ;
278
+ }
279
+
260
280
// getting the list of files from the root
261
281
if ( ! path ) {
262
282
data = await listS3Contents (
@@ -779,6 +799,7 @@ export class Drive implements Contents.IDrive {
779
799
private _s3Client : S3Client ;
780
800
private _name : string = '' ;
781
801
private _root : string = '' ;
802
+ private _isRootFormatted : boolean = false ;
782
803
private _provider : string = '' ;
783
804
private _baseUrl : string = '' ;
784
805
private _region : string = '' ;
0 commit comments