You are reading a single comment by @andrewg_oz and its replies. Click here to read the full conversation.
  • OK. Thanks for your help. I'll just summarize all this for future reference:

    function loadSettings() {
      Util.showModal("Loading...");
      Puck.eval(`require("Storage").read(${JSO­N.stringify("myapp.json")})`,data=>{
        Util.hideModal();
        try {
          settings = JSON.parse(data);
        } catch {
          settings = defaultSettings;
        }
      });
    }
    function saveSettings() {
      Util.showModal("Saving...");
      Puck.write(`\x10require("Storage").write­(${JSON.stringify("myapp.json")},${JSON.­stringify(settings)})\n`,()=>{
        Util.hideModal();
      });
    }
    
About

Avatar for andrewg_oz @andrewg_oz started