File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 176176 }
177177 }, 1000 );
178178 $effect (() => {
179+ // Allow cell changes with get or update to trigger save. Those updates
180+ // change forceSave
181+ globals .forceSave ;
179182 save ({
180183 sheets: [
181184 // Spreads necessary for reactivity
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ functions.crypto = async (ticker) => {
5353 settings = $state ( {
5454 mobileZoom : 100 ,
5555 } ) ;
56+ forceSave = $state ( 0 ) ;
5657
5758 static load ( data ) {
5859 let result = new State (
@@ -514,7 +515,21 @@ export class Sheet {
514515 ) ;
515516 cell . value . rederive (
516517 flattenArgs ( computed ) ,
517- ( dependencyValues , set , update ) => {
518+ ( dependencyValues , _set , _update ) => {
519+ const set = ( ...args ) => {
520+ try {
521+ return _set ( ...args ) ;
522+ } finally {
523+ this . globals . forceSave ++ ;
524+ }
525+ } ;
526+ const update = ( ...args ) => {
527+ try {
528+ return _update ( ...args ) ;
529+ } finally {
530+ this . globals . forceSave ++ ;
531+ }
532+ } ;
518533 let _this = {
519534 set,
520535 update,
You can’t perform that action at this time.
0 commit comments