File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,13 @@ export class IDBBatchAtomicVFS extends VFS.Base {
356356 const file = this . #mapIdToFile. get ( fileId ) ;
357357 log ( `xSync ${ file . path } ${ flags } ` ) ;
358358 try {
359+ if ( file . isMetadataChanged ) {
360+ // Metadata has changed so write block 0 to IndexedDB.
361+ this . #idb. run ( 'readwrite' , async ( { blocks} ) => {
362+ await blocks . put ( file . block0 ) ;
363+ } ) ;
364+ file . isMetadataChanged = false ;
365+ }
359366 await this . #idb. sync ( ) ;
360367 } catch ( e ) {
361368 console . error ( e ) ;
@@ -502,6 +509,7 @@ export class IDBBatchAtomicVFS extends VFS.Base {
502509 this . #idb. run ( 'readwrite' , async ( { blocks} ) => {
503510 await blocks . put ( file . block0 ) ;
504511 } ) ;
512+ file . isMetadataChanged = false ;
505513 } catch ( e ) {
506514 console . error ( e ) ;
507515 return VFS . SQLITE_IOERR ;
You can’t perform that action at this time.
0 commit comments