File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ export async function exportNotes(
9292 const { createZipStream } = await import ( "../utils/streams/zip-stream" ) ;
9393
9494 const errors : Error [ ] = [ ] ;
95- const exportStream = new ExportStream ( report , ( e ) => errors . push ( e ) ) ;
95+ const exportStream = new ExportStream (
96+ report ,
97+ ( e ) => errors . push ( e ) ,
98+ await notes . count ( )
99+ ) ;
96100 await fromAsyncIterator (
97101 _exportNotes ( notes , { format, unlockVault : Vault . unlockVault } )
98102 )
Original file line number Diff line number Diff line change @@ -28,8 +28,13 @@ export class ExportStream extends TransformStream<
2828> {
2929 progress = 0 ;
3030 constructor (
31- report : ( progress : { text : string ; current ?: number } ) => void ,
32- handleError : ( error : Error ) => void
31+ report : ( progress : {
32+ text : string ;
33+ current ?: number ;
34+ total ?: number ;
35+ } ) => void ,
36+ handleError : ( error : Error ) => void ,
37+ totalItems ?: number
3338 ) {
3439 super ( {
3540 transform : async ( item , controller ) => {
@@ -69,7 +74,8 @@ export class ExportStream extends TransformStream<
6974 controller . enqueue ( item ) ;
7075 report ( {
7176 current : this . progress ++ ,
72- text : `Exporting note: ${ item . path } `
77+ text : `Exporting note: ${ item . path } ` ,
78+ total : totalItems
7379 } ) ;
7480 }
7581 }
You can’t perform that action at this time.
0 commit comments