While fiddling with adding to the desktop Preferences panel for this PR, I got quite confused by the fact that my code I was adding in ElectronClient/app/lib/models/Setting.js
seemed to get deleted every time I rebuilt the desktop app.
Then I realized that it must be auto-generated on build or something, and that I should actually be editing ReactNativeClient/lib/models/Setting.js
to get the effect I wanted. Once I did that, the code was then copied correctly into the corresponding ElectronClient/
file I’d previously been trying to edit directly, and the Preference pane successfully updated.
This was pretty confusing, and I imagine it’ll confuse other devs in the future too. Would it make sense to add a message something like this to the top of the ReactNativeClient/
file (and thus the generated ElectronClient/
file too)?
/***********************************************************************
***********************************************************************
**** ****
**** Each build regenerates ****
**** ElectronClient/app/lib/models/Setting.js from ****
**** ReactNativeClient/lib/models/Setting.js, so only edit the ****
**** latter and not the former, otherwise you'll be confused ****
**** about why your code keeps disappearing. ****
**** ****
***********************************************************************
***********************************************************************/
This isn’t exactly an elegant solution, so I’d love other better ideas too!