File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class DriveManager extends EventEmitter {
18
18
this . opts = opts || { }
19
19
20
20
this . _driveIndex = sub ( this . db , 'drives' , { valueEncoding : 'json' } )
21
- this . _nameIndex = sub ( this . db , 'names' , { valueEncoding : 'utf8 ' } )
21
+ this . _nameIndex = sub ( this . db , 'names' , { valueEncoding : 'utf-8 ' } )
22
22
23
23
if ( this . opts . stats ) {
24
24
this . _statsIndex = sub ( this . db , 'stats' , { valueEncoding : 'json' } )
@@ -78,7 +78,7 @@ class DriveManager extends EventEmitter {
78
78
}
79
79
80
80
_generateName ( key ) {
81
- if ( key ) return key
81
+ if ( key ) return key . toString ( 'hex' )
82
82
// TODO: check collisions
83
83
return crypto . randomBytes ( 64 ) . toString ( 'hex' )
84
84
}
@@ -112,7 +112,7 @@ class DriveManager extends EventEmitter {
112
112
newDrive = true
113
113
}
114
114
115
- const corestore = this . megastore . get ( name , { ...this . opts , ... opts } )
115
+ const corestore = this . megastore . get ( name , { ...this . opts } )
116
116
const driveOpts = {
117
117
...opts ,
118
118
sparse : opts . sparse !== false ,
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ class FuseManager extends EventEmitter {
249
249
return this . _rootDrive . readFile ( p . join ( relativePath , '.key' ) , ( err , key ) => {
250
250
if ( err && err . errno !== 2 ) return reject ( err )
251
251
key = key ? datEncoding . decode ( key . toString ( 'utf8' ) ) : opts . key
252
- return this . driveManager . get ( key , { ...opts , seed : false } )
252
+ return this . driveManager . get ( key , { ...opts , seed : ! ! key } )
253
253
. then ( drive => resolve ( { drive, root : false , relativePath } ) )
254
254
. catch ( reject )
255
255
} )
You can’t perform that action at this time.
0 commit comments