diff --git a/state/local/local.ts b/state/local/local.ts index 84b2ff4e3bb..dabe1636ca9 100644 --- a/state/local/local.ts +++ b/state/local/local.ts @@ -48,11 +48,7 @@ namespace $ { this.native().removeItem( key ) } else { this.native().setItem( key , JSON.stringify( next ) ) - try { - this.$.$mol_storage.persisted( true ) - } catch( error ) { - $mol_fail_log( error ) - } + this.$.$mol_storage.persisted( true ) } return next diff --git a/storage/storage.web.ts b/storage/storage.web.ts index d828f306638..d230d18bee2 100644 --- a/storage/storage.web.ts +++ b/storage/storage.web.ts @@ -3,24 +3,23 @@ namespace $ { @ $mol_mem static native() { - return $mol_wire_sync( this.$.$mol_dom_context.navigator.storage ) + return this.$.$mol_dom_context.navigator.storage } @ $mol_mem static persisted( next?: boolean ): boolean { $mol_mem_persist() const native = this.native() - const prev = $mol_mem_cached( ()=> this.persisted() ) ?? native.persisted() - if( next && !prev ) native.persist() - return next ?? prev + if( next ) native.persist() + return next ?? $mol_wire_sync( native ).persisted() } static estimate() { - return this.native().estimate() + return $mol_wire_sync( this.native() ).estimate() } static dir() { - return this.native().getDirectory() + return $mol_wire_sync( this.native() ).getDirectory() } }