mavoweb / mavo

Create web applications entirely by writing HTML and CSS!
https://mavo.io
MIT License
2.85k stars 176 forks source link

When you create a new mavo app with no data by default, autosave saves an empty json file #874

Open karger opened 2 years ago

karger commented 2 years ago

I'm defining a mavo app where a different instances get different data files through manipulation of the mv-storage attribute. When a new instance is created it is initially empty, and since I have autosave enabled, mavo immediately saves an empty file. This is going to have the undesirable behavior of generating a large number of empty json files corresponding to all the times someone "opened an instance" then canceled without making any edits. It would be nice if there were a way to prevent saving an initially empty json (obviously, if the json is not empty but becomes empty, you need to save in order to delete the old content). At least for autosave---perhaps there is a way to tell autosave to treat the initial empty content as "clean" and not in need of saving?

joyously commented 2 years ago

Maybe manipulate the autosave also, so it's not set until the mv-storage is set.